From d53ccfd8e51065d0f8895f959b132e1fb7843429 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Fri, 10 Nov 2017 14:22:38 +0100 Subject: [PATCH] parsebin: Check for shutdown before exposing pads We already checked previously, but we need to do it before adding pads. --- gst/playback/gstparsebin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gst/playback/gstparsebin.c b/gst/playback/gstparsebin.c index 0768056..d384b75 100644 --- a/gst/playback/gstparsebin.c +++ b/gst/playback/gstparsebin.c @@ -3539,6 +3539,15 @@ retry: /* re-order pads : video, then audio, then others */ endpads = g_list_sort (endpads, (GCompareFunc) sort_end_pads); + /* Don't expose if we're currently shutting down */ + DYN_LOCK (parsebin); + if (G_UNLIKELY (parsebin->shutdown)) { + GST_WARNING_OBJECT (parsebin, + "Currently, shutting down, aborting exposing"); + DYN_UNLOCK (parsebin); + return FALSE; + } + /* Expose pads */ for (tmp = endpads; tmp; tmp = tmp->next) { GstParsePad *parsepad = (GstParsePad *) tmp->data; @@ -3578,6 +3587,8 @@ retry: GST_INFO_OBJECT (parsepad, "added new parsed pad"); } + DYN_UNLOCK (parsebin); + /* Unblock internal pads. The application should have connected stuff now * so that streaming can continue. */ for (tmp = endpads; tmp; tmp = tmp->next) { -- 2.7.4