Partial redirect handling.
authorIlpo Ruotsalainen <ilpo.ruotsalainen@movial.fi>
Thu, 13 Nov 2008 11:04:52 +0000 (13:04 +0200)
committerIlpo Ruotsalainen <ilpo.ruotsalainen@movial.fi>
Thu, 13 Nov 2008 11:04:52 +0000 (13:04 +0200)
isatis-player/player.c

index 7dd54ef..e7db439 100644 (file)
@@ -229,6 +229,24 @@ static void buffering_callback(GstBus *bus, GstMessage *message, PlayerInternal
        }
 }
 
+static void element_callback(GstBus *bus, GstMessage *message, PlayerInternal *priv)
+{
+       if (gst_structure_has_name(message->structure, "redirect"))
+       {
+               const gchar *uri;
+
+               uri = gst_structure_get_string(message->structure, "new-location");
+
+               if (uri == NULL)
+               {
+                       g_debug("redirect did not contain a new location");
+                       return;
+               }
+
+               g_debug("redirecting to %s", uri);
+       }
+}
+
 static gboolean paint_label_background_callback(GtkWidget *widget, GdkEventExpose *event, void *unused)
 {
        if (GTK_WIDGET_DRAWABLE(widget))
@@ -383,6 +401,7 @@ int main(int argc, char **argv)
        g_signal_connect(bus, "message::error", G_CALLBACK(error_callback), priv);
        g_signal_connect(bus, "message::eos", G_CALLBACK(eos_callback), priv);
        g_signal_connect(bus, "message::buffering", G_CALLBACK(buffering_callback), priv);
+       g_signal_connect(bus, "message::element", G_CALLBACK(element_callback), priv);
 
        g_timeout_add(250, (GSourceFunc)update_progress_callback, priv);