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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2236>
This commit is contained in:
Jan Schmidt 2022-01-18 05:48:08 +11:00 committed by Tim-Philipp Müller
parent 5e3864159b
commit 45a709cf43

View file

@ -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);