From fa7ad8743c47ec9256cf4f6e16c1bb8c57d91db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 May 2013 13:41:46 +0200 Subject: [PATCH] decodebin: Lock the state of child elements as long as we manage their states https://bugzilla.gnome.org/show_bug.cgi?id=690420 --- gst/playback/gstdecodebin2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index 89ef818a58..499fe104ea 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -2016,6 +2016,9 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, * to error while we test it using READY state. */ add_error_filter (dbin, element); + /* We don't yet want the bin to control the element's state */ + gst_element_set_locked_state (element, TRUE); + /* ... add it ... */ if (!(gst_bin_add (GST_BIN_CAST (dbin), element))) { GST_WARNING_OBJECT (dbin, "Couldn't add %s to the bin", @@ -2203,6 +2206,10 @@ connect_pad (GstDecodeBin * dbin, GstElement * src, GstDecodePad * dpad, continue; } + + /* Now let the bin handle the state */ + gst_element_set_locked_state (element, FALSE); + if (subtitle) { SUBTITLE_LOCK (dbin); /* we added the element now, add it to the list of subtitle-encoding @@ -3193,8 +3200,8 @@ gst_decode_group_new (GstDecodeBin * dbin, GstDecodeChain * parent) group->overrunsig = g_signal_connect (mq, "overrun", G_CALLBACK (multi_queue_overrun_cb), group); - gst_bin_add (GST_BIN (dbin), gst_object_ref (mq)); gst_element_set_state (mq, GST_STATE_PAUSED); + gst_bin_add (GST_BIN (dbin), gst_object_ref (mq)); return group;