mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
don't recursively call gst_bin_set_state on failure don't do unnecessary state changes
Original commit message from CVS: don't recursively call gst_bin_set_state on failure don't do unnecessary state changes
This commit is contained in:
parent
c349a582b4
commit
31d75cf682
3 changed files with 21 additions and 3 deletions
15
gst/gstbin.c
15
gst/gstbin.c
|
@ -663,12 +663,22 @@ gst_bin_change_state (GstElement * element)
|
|||
pending = GST_STATE_PENDING (element);
|
||||
transition = GST_STATE_TRANSITION (element);
|
||||
|
||||
GST_INFO_ELEMENT (GST_CAT_STATES, element, "changing childrens' state from %s to %s",
|
||||
gst_element_state_get_name (old_state), gst_element_state_get_name (pending));
|
||||
GST_INFO_ELEMENT (GST_CAT_STATES, element,
|
||||
"changing childrens' state from %s to %s",
|
||||
gst_element_state_get_name (old_state),
|
||||
gst_element_state_get_name (pending));
|
||||
|
||||
if (pending == GST_STATE_VOID_PENDING)
|
||||
return GST_STATE_SUCCESS;
|
||||
|
||||
if (old_state == pending)
|
||||
{
|
||||
GST_INFO_ELEMENT (GST_CAT_STATES, element,
|
||||
"old and pending state are both %s, returning",
|
||||
gst_element_state_get_name (pending));
|
||||
return GST_STATE_SUCCESS;
|
||||
}
|
||||
|
||||
children = bin->children;
|
||||
|
||||
while (children) {
|
||||
|
@ -694,7 +704,6 @@ gst_bin_change_state (GstElement * element)
|
|||
if (GST_ELEMENT_SCHED (child) == GST_ELEMENT_SCHED (element)) {
|
||||
/* try to reset it to what is was */
|
||||
GST_STATE_PENDING (element) = old_state;
|
||||
gst_bin_change_state (element);
|
||||
|
||||
return GST_STATE_FAILURE;
|
||||
}
|
||||
|
|
|
@ -2238,6 +2238,14 @@ gst_element_set_state (GstElement *element, GstElementState state)
|
|||
/* start with the current state */
|
||||
curpending = GST_STATE(element);
|
||||
|
||||
if (state == curpending)
|
||||
{
|
||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element,
|
||||
"element is already in requested state %s",
|
||||
gst_element_state_get_name (state));
|
||||
return (GST_STATE_SUCCESS);
|
||||
}
|
||||
|
||||
GST_DEBUG_ELEMENT (GST_CAT_STATES, element, "setting state from %s to %s",
|
||||
gst_element_state_get_name (curpending),
|
||||
gst_element_state_get_name (state));
|
||||
|
|
|
@ -2278,6 +2278,7 @@ gst_pad_push (GstPad *pad, GstBuffer *buf)
|
|||
GstRealPad *peer;
|
||||
GstData *data = GST_DATA(buf);
|
||||
|
||||
g_assert (GST_IS_PAD (pad));
|
||||
GST_DEBUG_ENTER ("(%s:%s)", GST_DEBUG_PAD_NAME (pad));
|
||||
|
||||
g_return_if_fail (GST_PAD_DIRECTION (pad) == GST_PAD_SRC);
|
||||
|
|
Loading…
Reference in a new issue