From 8f627b1f9c83ff3e5b58aab75fcccb648bdbaaea Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 20 May 2025 08:21:51 +0200 Subject: [PATCH] uridecodebin3: Don't hold play items lock while releasing pads Releasing the pad can cause messages that call back into the message handler of uridecodebin3 and take exactly the same lock again. Fix #4443 Part-of: --- subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c index f718388706..c5ccd3178d 100644 --- a/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c @@ -1128,8 +1128,12 @@ switch_and_activate_input_locked (GstURIDecodeBin3 * uridecodebin, GstSourcePad *old_spad = iterold->data; if (old_spad->db3_sink_pad) { GST_DEBUG_OBJECT (uridecodebin, "Releasing no longer used db3 pad"); + /* Temporarily release play items lock to avoid deadlock if releasing the + * pad causes a message that calls back into our message handler. */ + PLAY_ITEMS_UNLOCK (uridecodebin); gst_element_release_request_pad (uridecodebin->decodebin, old_spad->db3_sink_pad); + PLAY_ITEMS_LOCK (uridecodebin); old_spad->db3_sink_pad = NULL; } }