decodebin2: Recheck shutdown behaviour in error case
authorEdward Hervey <edward@centricular.com>
Thu, 2 Nov 2017 06:55:16 +0000 (07:55 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 2 Nov 2017 06:55:16 +0000 (07:55 +0100)
If we can expose the main chain, recheck whether we are shutting
down or not.

decodebin2 might have been set to READY/NULL during the attempt
to expose, which would cause it to fail ... but it is not a fatal
issue.

gst/playback/gstdecodebin2.c

index c7d3771..e7eb66b 100644 (file)
@@ -4588,6 +4588,14 @@ retry:
     g_list_foreach (endpads, (GFunc) gst_object_unref, NULL);
     g_list_free (endpads);
     g_string_free (missing_plugin_details, TRUE);
+    /* Failures could be due to the fact that we are currently shutting down (recheck) */
+    DYN_LOCK (dbin);
+    if (G_UNLIKELY (dbin->shutdown)) {
+      GST_WARNING_OBJECT (dbin, "Currently, shutting down, aborting exposing");
+      DYN_UNLOCK (dbin);
+      return FALSE;
+    }
+    DYN_UNLOCK (dbin);
     GST_ERROR_OBJECT (dbin, "Broken chain/group tree");
     g_return_val_if_reached (FALSE);
     return FALSE;