From 52d9614d47f1a88f5939abf5bc273dcda777d2e8 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Tue, 18 Jan 2022 05:48:08 +1100 Subject: [PATCH] playbin3: Hold playbin lock on pad-added Take the playbin lock when accessing the combiner to add a new pad to link to. Fixes races against streams-selected messages triggering reconfiguration. Part-of: --- subprojects/gst-plugins-base/gst/playback/gstplaybin3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c b/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c index 1192101..55f7165 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstplaybin3.c @@ -3113,6 +3113,7 @@ pad_added_cb (GstElement * uridecodebin, GstPad * pad, GstSourceGroup * group) goto unknown_type; } + GST_PLAY_BIN3_LOCK (playbin); combine = &playbin->combiner[pb_stream_type]; combiner_control_pad (playbin, combine, pad); @@ -3127,6 +3128,7 @@ pad_added_cb (GstElement * uridecodebin, GstPad * pad, GstSourceGroup * group) group->pending_about_to_finish = FALSE; emit_about_to_finish (playbin); } + GST_PLAY_BIN3_UNLOCK (playbin); GST_PLAY_BIN3_SHUTDOWN_UNLOCK (playbin); -- 2.7.4