From f448cecceb8ffa2bb550e93aef3e256375d90e1b Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 2 Nov 2017 07:55:16 +0100 Subject: [PATCH] decodebin2: Recheck shutdown behaviour in error case 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index c7d3771..e7eb66b 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -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; -- 2.7.4