diff --git a/ChangeLog b/ChangeLog index 33720086f5..feadd1def5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-12-01 Ronald S. Bultje + + * 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 * gst/playback/gststreaminfo.c: (stream_info_mute_pad): diff --git a/gst/playback/gstplaybin.c b/gst/playback/gstplaybin.c index c59e88c5e5..88dd263cf2 100644 --- a/gst/playback/gstplaybin.c +++ b/gst/playback/gstplaybin.c @@ -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) {