From 22917b140ffac5208eff173321fa7cdad8976cca Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 10 Jan 2023 11:19:12 +0100 Subject: [PATCH] decodebin3: ensure recalculate_group_id() is called with INPUT lock This function uses main_input and current_group_id which are protected by the input lock. Some calls were already safe but not all. Part-of: --- subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 7d733d34e0..a049e237bd 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -972,6 +972,7 @@ query_duration_drop_probe (GstPad * pad, GstPadProbeInfo * info, return ret; } +/* CALL with INPUT LOCK */ static void recalculate_group_id (GstDecodebin3 * dbin) { @@ -1003,6 +1004,7 @@ reset_input_parsebin (GstDecodebin3 * dbin, DecodebinInput * input) GST_DEBUG_OBJECT (dbin, "Resetting %" GST_PTR_FORMAT, input->parsebin); + INPUT_LOCK (dbin); GST_STATE_LOCK (dbin); gst_element_set_state (input->parsebin, GST_STATE_NULL); input->drained = FALSE; @@ -1015,6 +1017,7 @@ reset_input_parsebin (GstDecodebin3 * dbin, DecodebinInput * input) } gst_element_sync_state_with_parent (input->parsebin); GST_STATE_UNLOCK (dbin); + INPUT_UNLOCK (dbin); } @@ -1306,7 +1309,9 @@ sink_event_function (GstPad * sinkpad, GstDecodebin3 * dbin, GstEvent * event) /* Make sure group ids will be recalculated */ input->group_id = GST_GROUP_ID_INVALID; + INPUT_LOCK (dbin); recalculate_group_id (dbin); + INPUT_UNLOCK (dbin); break; } case GST_EVENT_STREAM_COLLECTION: