Revert "nleobject: Start up in NULL->READY->PAUSED after the parent class did"
authorSebastian Dröge <sebastian@centricular.com>
Thu, 17 Nov 2016 07:40:33 +0000 (09:40 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 17 Nov 2016 07:40:33 +0000 (09:40 +0200)
This reverts commit 5f7943c59d9def8c2dc9983936463462c1cdf63f.

plugins/nle/nleobject.c

index 5f7a8bb..46694a4 100644 (file)
@@ -630,21 +630,7 @@ nle_object_change_state (GstElement * element, GstStateChange transition)
 {
   GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
 
-  GST_DEBUG_OBJECT (element, "Calling parent change_state");
-
-  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
-  GST_DEBUG_OBJECT (element, "Return from parent change_state was %d", ret);
-
-  if (ret == GST_STATE_CHANGE_FAILURE)
-    goto beach;
-
   switch (transition) {
-    case GST_STATE_CHANGE_PAUSED_TO_READY:
-      /* cleanup nleobject */
-      if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)
-        ret = GST_STATE_CHANGE_FAILURE;
-      break;
     case GST_STATE_CHANGE_NULL_TO_READY:
     {
       GstObject *parent = gst_object_get_parent (GST_OBJECT (element));
@@ -673,6 +659,25 @@ nle_object_change_state (GstElement * element, GstStateChange transition)
       break;
   }
 
+  GST_DEBUG_OBJECT (element, "Calling parent change_state");
+
+  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+  GST_DEBUG_OBJECT (element, "Return from parent change_state was %d", ret);
+
+  if (ret == GST_STATE_CHANGE_FAILURE)
+    goto beach;
+
+  switch (transition) {
+    case GST_STATE_CHANGE_PAUSED_TO_READY:
+      /* cleanup nleobject */
+      if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)
+        ret = GST_STATE_CHANGE_FAILURE;
+      break;
+    default:
+      break;
+  }
+
 beach:
   return ret;
 }