nlecomposition: Don't keep sync state of child on activation failure

This will result in downward state change failure eventually
when user is finalizing top level (i.g., gespipeline) bin.
This commit is contained in:
Seungha Yang 2019-02-01 15:37:42 +09:00 committed by Thibault Saunier
parent 78f411d1de
commit 08c70424c2

View file

@ -2899,14 +2899,16 @@ _activate_new_stack (NleComposition * comp)
GST_DEBUG_OBJECT (comp, "New stack activated!");
resync_state:
if (!gst_element_set_locked_state (priv->current_bin, FALSE)) {
GST_ERROR_OBJECT (comp, "set locked state failure");
return FALSE;
}
gst_element_set_locked_state (priv->current_bin, FALSE);
GST_DEBUG ("going back to parent state");
if (!gst_element_sync_state_with_parent (priv->current_bin)) {
GST_ERROR_OBJECT (comp, "Cannot sync current stack's state");
gst_element_set_locked_state (priv->current_bin, TRUE);
gst_element_set_state (priv->current_bin, GST_STATE_NULL);
GST_ELEMENT_ERROR (comp, CORE, STATE_CHANGE, (NULL),
("Could not sync %" GST_PTR_FORMAT " state with parent",
priv->current_bin));
return FALSE;
}