From 677b6f71485963a5e6fa9bf4c5730fceaadba746 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Wed, 25 Oct 2023 14:12:16 +0100 Subject: [PATCH] decodebin3: Dispose decoder in case linking failed Otherwise it will be leaked and remain forever in the bin when trying the next decoder candidate. Part-of: --- subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c index 32a0ec8b48..2fc84078f8 100644 --- a/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c +++ b/subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c @@ -2831,7 +2831,9 @@ remove_decoder_link (DecodebinOutputStream * output, MultiQueueSlot * slot) { GstDecodebin3 *dbin = output->dbin; - gst_pad_unlink (slot->src_pad, output->decoder_sink); + if (gst_pad_is_linked (output->decoder_sink)) { + gst_pad_unlink (slot->src_pad, output->decoder_sink); + } if (output->drop_probe_id) { gst_pad_remove_probe (slot->src_pad, output->drop_probe_id); output->drop_probe_id = 0; @@ -2979,6 +2981,7 @@ reconfigure_output_stream (DecodebinOutputStream * output, GST_PAD_LINK_CHECK_NOTHING) != GST_PAD_LINK_OK) { GST_WARNING_OBJECT (dbin, "could not link to %s:%s", GST_DEBUG_PAD_NAME (output->decoder_sink)); + decoder_failed = TRUE; goto try_next; }