diff --git a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c index c54a2891f4..2c0bab3fcc 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturisourcebin.c @@ -1943,8 +1943,13 @@ setup_parsebin_for_slot (ChildSrcPadInfo * info, GstPad * originating_pad) GST_DEBUG_OBJECT (urisrc, "Setting up parsebin for %" GST_PTR_FORMAT, originating_pad); - GST_STATE_LOCK (urisrc); GST_URI_SOURCE_BIN_LOCK (urisrc); + if (urisrc->flushing) { + GST_DEBUG_OBJECT (urisrc, "Shutting down, returning early"); + GST_URI_SOURCE_BIN_UNLOCK (urisrc); + return FALSE; + } + GST_STATE_LOCK (urisrc); /* Set up optional pre-parsebin download/ringbuffer elements */ if (info->use_downloadbuffer || urisrc->ring_buffer_max_size) { @@ -2014,8 +2019,8 @@ setup_parsebin_for_slot (ChildSrcPadInfo * info, GstPad * originating_pad) } gst_element_set_locked_state (info->demuxer, FALSE); gst_element_sync_state_with_parent (info->demuxer); - GST_URI_SOURCE_BIN_UNLOCK (urisrc); GST_STATE_UNLOCK (urisrc); + GST_URI_SOURCE_BIN_UNLOCK (urisrc); return TRUE; could_not_link: @@ -2024,8 +2029,8 @@ could_not_link: gst_element_set_locked_state (info->pre_parse_queue, FALSE); if (info->demuxer) gst_element_set_locked_state (info->demuxer, FALSE); - GST_URI_SOURCE_BIN_UNLOCK (urisrc); GST_STATE_UNLOCK (urisrc); + GST_URI_SOURCE_BIN_UNLOCK (urisrc); GST_ELEMENT_ERROR (urisrc, CORE, NEGOTIATION, (NULL), ("Can't link to (pre-)parsebin element")); return FALSE;