summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2020-12-24 11:44:27 +0200
committerTim-Philipp Müller <tim@centricular.com>2021-01-13 01:25:17 +0000
commit8e0febbb8abeb08d8deb11dcdb1f06bd6e99a745 (patch)
treeb6cf3e2b734b4d3be0dc5edf646e060ceec367dc
parent9ea2c570d1f86f32b5af56cfee739a175fd65ccc (diff)
downloadgstreamer-plugins-base-8e0febbb8abeb08d8deb11dcdb1f06bd6e99a745.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/987>
-rw-r--r--gst/playback/gstdecodebin3.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c
index 968a6347f..6d881f750 100644
--- a/gst/playback/gstdecodebin3.c
+++ b/gst/playback/gstdecodebin3.c
@@ -2209,6 +2209,15 @@ reconfigure_output_stream (DecodebinOutputStream * output,
gst_bin_remove ((GstBin *) dbin, output->decoder);
output->decoder = NULL;
+ } 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);