From 353691602e3dd489132aab4ed0972b378603183c Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 9 Aug 2022 10:42:22 +0200 Subject: [PATCH] uridecodebin3: Fix shutdown procedures in probe When shutting down, we want to remove the urisourcebin blocking probes ... but we also want to propagate a GST_FLOW_FLUSHING upstream (and not GST_FLOW_NOT_LINKED) to make the upstream task gracefully stop instead of posting an error message. Part-of: --- .../gst-plugins-base/gst/playback/gsturidecodebin3.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c index 3750a01a85..7324571509 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c @@ -1255,8 +1255,15 @@ uri_src_block_probe (GstPad * pad, GstPadProbeInfo * info, shutdown: { GST_LOG_OBJECT (pad, "Shutting down"); + /* We are shutting down, we both want to remove this probe and propagate a + * GST_FLOW_FLUSHING upstream (to cause tasks to stop) */ + if (srcpad->block_probe_id) + gst_pad_remove_probe (pad, srcpad->block_probe_id); + srcpad->block_probe_id = 0; PLAY_ITEMS_UNLOCK (handler->uridecodebin); - return GST_PAD_PROBE_REMOVE; + GST_PAD_PROBE_INFO_FLOW_RETURN (info) = GST_FLOW_FLUSHING; + gst_mini_object_unref (GST_PAD_PROBE_INFO_DATA (info)); + return GST_PAD_PROBE_HANDLED; } }