From da696477c6c94b7a39c52325c7f5528ea08a5479 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 21 Dec 2022 10:44:40 +0100 Subject: [PATCH] decodebin3: fix dead lock when removing pad gst_element_remove_pad() is triggering a call to gst_decodebin3_input_pad_unlink() which needs the input lock as well, resulting in a dead lock. Fix #1667 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 97a476b298..7d733d34e0 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -711,6 +711,7 @@ gst_decodebin3_dispose (GObject * object) gst_clear_object (&dbin->collection); + INPUT_LOCK (dbin); if (dbin->main_input) { free_input (dbin, dbin->main_input); dbin->main_input = NULL; @@ -724,6 +725,7 @@ gst_decodebin3_dispose (GObject * object) free_input (dbin, input); dbin->other_inputs = g_list_delete_link (dbin->other_inputs, walk); } + INPUT_UNLOCK (dbin); G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -1170,7 +1172,10 @@ free_input (GstDecodebin3 * dbin, DecodebinInput * input) GST_LOG_OBJECT (dbin, "Freeing input %p", input); + INPUT_UNLOCK (dbin); gst_element_remove_pad (GST_ELEMENT (dbin), input->ghost_sink); + INPUT_LOCK (dbin); + g_free (input); }