bin: When going to READY make sure to always deactivate pads
authorSebastian Dröge <sebastian@centricular.com>
Fri, 25 Apr 2014 13:38:39 +0000 (15:38 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 25 Apr 2014 13:38:39 +0000 (15:38 +0200)
We might not have reached PAUSED yet because of an async error,
but nonetheless we want to make sure that the pads are always
deactivated in READY state.

gst/gstbin.c

index 8fbac35c2e2a4c06a0258a86d02f4c0fb0c2ec3c..66659280b1932257faea9a2a4acef389ce1ab9b2 100644 (file)
@@ -2579,9 +2579,10 @@ gst_bin_change_state_func (GstElement * element, GstStateChange transition)
       GST_DEBUG_OBJECT (element, "clearing all cached messages");
       bin_remove_messages (bin, NULL, GST_MESSAGE_ANY);
       GST_OBJECT_UNLOCK (bin);
-      if (current == GST_STATE_PAUSED)
-        if (!(gst_bin_src_pads_activate (bin, FALSE)))
-          goto activate_failure;
+      /* We might not have reached PAUSED yet due to async errors,
+       * make sure to always deactivate the pads nonetheless */
+      if (!(gst_bin_src_pads_activate (bin, FALSE)))
+        goto activate_failure;
       break;
     case GST_STATE_NULL:
       if (current == GST_STATE_READY) {