decodebin3: Add missing INPUT_LOCK() before ensure_input_parsebin()

ensure_input_parsebin() has a top comment saying it must be called with
INPUT_LOCK taken, but 2 out of 3 usages of the function call it without
taking that mutex.

This patch adds locking in these two remaining usages.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5279>
This commit is contained in:
Alicia Boya García 2023-09-05 13:04:10 +02:00 committed by GStreamer Marge Bot
parent 522704d308
commit 223b63b1d2

View file

@ -2159,7 +2159,9 @@ sink_event_function (GstPad * sinkpad, GstDecodebin3 * dbin, GstEvent * event)
if (!input->parsebin && !input->identity) {
if (gst_decodebin_input_requires_parsebin (input, newcaps)) {
GST_DEBUG_OBJECT (sinkpad, "parsebin is required for input");
INPUT_LOCK (dbin);
gst_decodebin_input_ensure_parsebin (input);
INPUT_UNLOCK (dbin);
break;
}
GST_DEBUG_OBJECT (sinkpad,
@ -2205,7 +2207,9 @@ sink_event_function (GstPad * sinkpad, GstDecodebin3 * dbin, GstEvent * event)
if (segment && segment->format != GST_FORMAT_TIME && !input->parsebin) {
GST_DEBUG_OBJECT (sinkpad,
"Got a non-time segment, forcing parsebin handling");
INPUT_LOCK (dbin);
gst_decodebin_input_ensure_parsebin (input);
INPUT_UNLOCK (dbin);
}
break;
}