From 946ce9b49a3ef4e1a80bf178c421127e6b317e01 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Wed, 1 Dec 2004 13:14:57 +0000 Subject: [PATCH] gst/playback/gstplaybin.c: Unlink manually since sometimes bin disposal (and therefore pad unlinking) is delayed, whi... 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 | 7 +++++++ gst/playback/gstplaybin.c | 4 ++++ 2 files changed, 11 insertions(+) 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) {