gst/playback/gstplaybasebin.c: Fix missing unlock.
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 19 May 2005 15:37:42 +0000 (15:37 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Thu, 19 May 2005 15:37:42 +0000 (15:37 +0000)
Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (probe_triggered):
Fix missing unlock.
* gst/playback/gstplaybin.c: (add_sink):
First add, then link (otherwise pad link fails).

ChangeLog
gst/playback/gstplaybasebin.c
gst/playback/gstplaybin.c

index 8b8d3f5..89bd979 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-19  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * gst/playback/gstplaybasebin.c: (probe_triggered):
+         Fix missing unlock.
+       * gst/playback/gstplaybin.c: (add_sink):
+         First add, then link (otherwise pad link fails).
+
 2005-05-19  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
 
        * examples/Makefile.am:
index 4da8314..dba17a5 100644 (file)
@@ -796,6 +796,9 @@ probe_triggered (GstProbe * probe, GstMiniObject ** data, gpointer user_data)
          * and continue, eventually the other streams will be EOSed and
          * we can switch out this group. */
         GST_DEBUG ("group %p not completely muted", group);
+
+        GROUP_UNLOCK (play_base_bin);
+
         /* remove the EOS if we have something left */
         return !have_left;
       }
index 2d89fe1..e7d5f18 100644 (file)
@@ -689,6 +689,8 @@ add_sink (GstPlayBin * play_bin, GstElement * sink, GstPad * srcpad)
   GstPadLinkReturn res;
   GstElement *parent;
 
+  gst_bin_add (GST_BIN (play_bin), sink);
+
   /* we found a sink for this stream, now try to install it */
   sinkpad = gst_element_get_pad (sink, "sink");
   res = gst_pad_link (srcpad, sinkpad);
@@ -707,6 +709,8 @@ add_sink (GstPlayBin * play_bin, GstElement * sink, GstPad * srcpad)
     capsstr = gst_caps_to_string (gst_pad_get_caps (srcpad));
     g_warning ("could not link %s", capsstr);
     g_free (capsstr);
+
+    gst_bin_remove (GST_BIN (play_bin), sink);
   } else {
     /* we got the sink succesfully linked, now keep the sink
      * in out internal list */
@@ -714,7 +718,6 @@ add_sink (GstPlayBin * play_bin, GstElement * sink, GstPad * srcpad)
     gst_element_set_state (sink,
         (GST_STATE (play_bin) == GST_STATE_PLAYING) ?
         GST_STATE_PLAYING : GST_STATE_PAUSED);
-    gst_bin_add (GST_BIN (play_bin), sink);
   }
 
   return res;