From: Wim Taymans Date: Mon, 17 Jun 2002 16:00:10 +0000 (+0000) Subject: Only revert the state of the failed element X-Git-Tag: BRANCH-RELEASE-0_4_0-ROOT~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8ca62be6e08bdb2e442091d0c8189e6f36b7cb5;p=platform%2Fupstream%2Fgstreamer.git Only revert the state of the failed element Original commit message from CVS: Only revert the state of the failed element --- diff --git a/gst/gstbin.c b/gst/gstbin.c index 8cc0ba9..dd4b187 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -526,20 +526,30 @@ gst_bin_change_state (GstElement * element) children = bin->children; while (children) { + GstElementState old_child_state; + child = GST_ELEMENT (children->data); children = g_list_next (children); + old_child_state = GST_STATE (child); + switch (gst_element_set_state (child, pending)) { case GST_STATE_FAILURE: GST_STATE_PENDING (element) = GST_STATE_VOID_PENDING; GST_DEBUG (GST_CAT_STATES, "child '%s' failed to go to state %d(%s)", GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending)); - gst_element_set_state (child, old_state); + gst_element_set_state (child, old_child_state); if (GST_ELEMENT_SCHED (child) == GST_ELEMENT_SCHED (element)) { /* reset to what is was */ GST_STATE_PENDING (element) = old_state; + gst_bin_change_state (element); + /* see if the old state was set */ + if (GST_STATE (element) == old_state) + return GST_STATE_SUCCESS; + + /* something wacky happened, we can't even go back */ return GST_STATE_FAILURE; } break;