gst/playback/: Activate dynamic pads before adding them to the element.
authorWim Taymans <wim.taymans@gmail.com>
Fri, 6 Oct 2006 14:37:43 +0000 (14:37 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 6 Oct 2006 14:37:43 +0000 (14:37 +0000)
Original commit message from CVS:
* gst/playback/gstdecodebin.c: (gst_decode_bin_init),
(close_pad_link):
* gst/playback/gstplaybasebin.c: (new_decoded_pad_full):
Activate dynamic pads before adding them to the element.

ChangeLog
gst/playback/gstdecodebin.c
gst/playback/gstplaybasebin.c

index 9483ef1..06cc8d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-06  Wim Taymans  <wim@fluendo.com>
+
+       * gst/playback/gstdecodebin.c: (gst_decode_bin_init),
+       (close_pad_link):
+       * gst/playback/gstplaybasebin.c: (new_decoded_pad_full):
+       Activate dynamic pads before adding them to the element.
+
 2006-10-06  Michael Smith  <msmith@fluendo.com>
 
        * gst-libs/gst/floatcast/floatcast.h:
index e4f1850..55267b2 100644 (file)
@@ -323,7 +323,7 @@ gst_decode_bin_init (GstDecodeBin * decode_bin)
   if (!decode_bin->typefind) {
     g_warning ("can't find typefind element, decodebin will not work");
   } else {
-    GstPad *pad;
+    GstPad *pad, *gpad;
 
     /* add the typefind element */
     if (!gst_bin_add (GST_BIN (decode_bin), decode_bin->typefind)) {
@@ -336,8 +336,9 @@ gst_decode_bin_init (GstDecodeBin * decode_bin)
     pad = gst_element_get_pad (decode_bin->typefind, "sink");
 
     /* ghost the sink pad to ourself */
-    gst_element_add_pad (GST_ELEMENT (decode_bin),
-        gst_ghost_pad_new ("sink", pad));
+    gpad = gst_ghost_pad_new ("sink", pad);
+    gst_pad_set_active (gpad, TRUE);
+    gst_element_add_pad (GST_ELEMENT (decode_bin), gpad);
 
     gst_object_unref (pad);
 
@@ -685,6 +686,7 @@ close_pad_link (GstElement * element, GstPad * pad, GstCaps * caps,
 
     /* make it a ghostpad */
     ghost = gst_ghost_pad_new (padname, pad);
+    gst_pad_set_active (ghost, TRUE);
     gst_element_add_pad (GST_ELEMENT (decode_bin), ghost);
 
     data = g_new0 (PadProbeData, 1);
index d4a73a6..78a797e 100644 (file)
@@ -1194,7 +1194,9 @@ new_decoded_pad_full (GstElement * element, GstPad * pad, gboolean last,
   }
 
   /* add to stream selector */
-  sinkpad = gst_element_get_pad (group->type[type - 1].selector, "sink%d");
+  sinkpad =
+      gst_element_get_request_pad (group->type[type - 1].selector, "sink%d");
+
   /* make sure we catch unlink signals */
   sig = g_signal_connect (G_OBJECT (sinkpad), "unlinked",
       G_CALLBACK (preroll_unlinked), play_base_bin);
@@ -1203,6 +1205,7 @@ new_decoded_pad_full (GstElement * element, GstPad * pad, gboolean last,
   /* Store a pointer to the stream selector pad for this stream */
   g_object_set_data (G_OBJECT (pad), "pb_sel_pad", sinkpad);
 
+  gst_pad_set_active (sinkpad, TRUE);
   gst_pad_link (pad, sinkpad);
   gst_object_unref (sinkpad);