gst/playback/gstplaybin.c: Unlink manually since sometimes bin disposal (and therefor...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 1 Dec 2004 13:14:57 +0000 (13:14 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Wed, 1 Dec 2004 13:14:57 +0000 (13:14 +0000)
Original commit message from CVS:
* gst/playback/gstplaybin.c: (remove_sinks), (setup_sinks):
Unlink manually since sometimes bin disposal (and therefore
pad unlinking) is delayed, which will cause a new media file
to not be able to start playing instantly.

ChangeLog
gst/playback/gstplaybin.c

index 3372008..feadd1d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-12-01  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * gst/playback/gstplaybin.c: (remove_sinks), (setup_sinks):
+         Unlink manually since sometimes bin disposal (and therefore
+         pad unlinking) is delayed, which will cause a new media file
+         to not be able to start playing instantly.
+
 2004-11-29  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * gst/playback/gststreaminfo.c: (stream_info_mute_pad):
index c59e88c..88dd263 100644 (file)
@@ -606,8 +606,11 @@ remove_sinks (GstPlayBin * play_bin)
 
   for (sinks = play_bin->sinks; sinks; sinks = g_list_next (sinks)) {
     GstElement *element = GST_ELEMENT (sinks->data);
+    GstPad *pad = gst_element_get_pad (element, "sink");
 
     GST_LOG ("removing sink %p", element);
+    if (GST_PAD_PEER (pad))
+      gst_pad_unlink (GST_PAD_PEER (pad), pad);
     gst_bin_remove (GST_BIN (play_bin), element);
   }
   g_list_free (play_bin->sinks);
@@ -741,6 +744,7 @@ setup_sinks (GstPlayBaseBin * play_base_bin)
           GST_STATE (sink), GST_STATE (play_bin),
           GST_STATE (gst_pad_get_parent (srcpad)));
       sinkpad = gst_element_get_pad (sink, "sink");
+
       /* try to link the pad of the sink to the stream */
       res = gst_pad_link (srcpad, sinkpad);
       if (!res) {