From d05ad920ce09b3b9c941f757163df9caacda97fd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 12 Jun 2012 17:11:51 +0200 Subject: [PATCH] bin: always recurse into bins when doing state changes Never skip the state change of a bin because it needs to update the base time of its children when needed. --- gst/gstbin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/gstbin.c b/gst/gstbin.c index 5a0aeabbc8..a9790ab203 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -2175,6 +2175,10 @@ gst_bin_element_set_state (GstBin * bin, GstElement * element, gst_element_state_get_name (child_pending), gst_element_state_get_name (next)); + /* always recurse into bins so that we can set the base time */ + if (GST_IS_BIN (element)) + goto do_state; + /* Try not to change the state of elements that are already in the state we're * going to */ if (child_current == next && child_pending == GST_STATE_VOID_PENDING) { @@ -2238,6 +2242,7 @@ gst_bin_element_set_state (GstBin * bin, GstElement * element, } } +do_state: GST_OBJECT_LOCK (bin); /* the element was busy with an upwards async state change, we must wait for * an ASYNC_DONE message before we attemp to change the state. */