nlecomposition: Don't keep sync state of child on activation failure
authorSeungha Yang <seungha.yang@navercorp.com>
Fri, 1 Feb 2019 06:37:42 +0000 (15:37 +0900)
committerThibault Saunier <tsaunier@gnome.org>
Wed, 6 Mar 2019 13:31:01 +0000 (13:31 +0000)
This will result in downward state change failure eventually
when user is finalizing top level (i.g., gespipeline) bin.

plugins/nle/nlecomposition.c

index 04cf2f0..363f873 100644 (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;
   }