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 8fbac35..6665928 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) {