From 667eadac92627a8e9229b83cd39d98ae91c37f30 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 3 Mar 2020 15:21:31 +0530 Subject: [PATCH] transcodebin: fix logs when failing to link filter - Display caps of the pad we actually tried to link. - Use the template caps as the filter is likely to not have any caps set yet. - Log pad name as well. --- gst/transcode/gsttranscodebin.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gst/transcode/gsttranscodebin.c b/gst/transcode/gsttranscodebin.c index 438d043c16..d3916c3ec2 100644 --- a/gst/transcode/gsttranscodebin.c +++ b/gst/transcode/gsttranscodebin.c @@ -147,13 +147,14 @@ _insert_filter (GstTranscodeBin * self, GstPad * sinkpad, GstPad * pad, gst_bin_add (GST_BIN (self), gst_object_ref (filter)); if (G_UNLIKELY (gst_pad_link (pad, filter_sink) != GST_PAD_LINK_OK)) { - GstCaps *othercaps = gst_pad_get_current_caps (sinkpad); + GstCaps *othercaps = gst_pad_get_pad_template_caps (filter_sink); caps = gst_pad_get_current_caps (pad); GST_ELEMENT_ERROR (self, CORE, PAD, (NULL), - ("Couldn't link pads \n\n%" GST_PTR_FORMAT "\n\n and \n\n %" - GST_PTR_FORMAT "\n\n", caps, othercaps)); + ("Couldn't link pads \n\n %" GST_PTR_FORMAT ": %" GST_PTR_FORMAT + "\n\n and \n\n %" GST_PTR_FORMAT ": %" GST_PTR_FORMAT + "\n\n", pad, caps, filter_sink, othercaps)); gst_caps_unref (caps); gst_caps_unref (othercaps);