From 15fb391401f300b6a63e117aaaa24a308148b754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 24 Dec 2020 11:44:27 +0200 Subject: [PATCH] decodebin3: When reconfiguring a slot make sure that the ghostpad is unlinked This was only taken care of previously if there was a decoder before. However if previously a decoder was not needed then the ghostpad would've been linked directly to the slot's srcpad. Reconfiguring the slot requires this to be undone so that linking can happen normally. Part-of: --- gst/playback/gstdecodebin3.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c index b932903572..dc7e217f20 100644 --- a/gst/playback/gstdecodebin3.c +++ b/gst/playback/gstdecodebin3.c @@ -2284,6 +2284,15 @@ reconfigure_output_stream (DecodebinOutputStream * output, gst_bin_remove ((GstBin *) dbin, output->decoder); output->decoder = NULL; output->decoder_latency = GST_CLOCK_TIME_NONE; + } else if (output->linked) { + /* Otherwise if we have no decoder yet but the output is linked make + * sure that the ghost pad is really unlinked in case no decoder was + * needed previously */ + if (!gst_ghost_pad_set_target ((GstGhostPad *) output->src_pad, NULL)) { + GST_ERROR_OBJECT (dbin, "Could not release ghost pad"); + gst_caps_unref (new_caps); + goto cleanup; + } } gst_caps_unref (new_caps);