Commit 69b5cb8a authored by Thibault Saunier's avatar Thibault Saunier 🌵 Committed by GStreamer Marge Bot

video-aggregator: Fix renegotiation when using convert pads

Since 23189c60 we started using the
useless result of `modified_caps` which, was never used since it was
introduced 7 years ago (in videomixer2). The intersection is useless and
we should just avoid doing it at all (which was always the case before)
as it can end up failing renegotiation for bad reasons.

Part-of: <gstreamer/gst-plugins-base!905>
parent d944c27d
Pipeline #220662 passed with stages
in 43 minutes and 31 seconds
......@@ -2491,10 +2491,7 @@ gst_video_aggregator_pad_sink_acceptcaps (GstPad * pad,
GstVideoAggregator * vagg, GstCaps * caps)
{
gboolean ret;
GstCaps *modified_caps;
GstCaps *accepted_caps;
GstCaps *template_caps;
gboolean had_current_caps = TRUE;
gint i, n;
GstStructure *s;
GstAggregator *agg = GST_AGGREGATOR (vagg);
......@@ -2503,12 +2500,8 @@ gst_video_aggregator_pad_sink_acceptcaps (GstPad * pad,
accepted_caps = gst_pad_get_current_caps (GST_PAD (agg->srcpad));
template_caps = gst_pad_get_pad_template_caps (GST_PAD (agg->srcpad));
if (accepted_caps == NULL) {
accepted_caps = template_caps;
had_current_caps = FALSE;
}
if (accepted_caps == NULL)
accepted_caps = gst_pad_get_pad_template_caps (GST_PAD (agg->srcpad));
accepted_caps = gst_caps_make_writable (accepted_caps);
......@@ -2528,15 +2521,10 @@ gst_video_aggregator_pad_sink_acceptcaps (GstPad * pad,
}
}
modified_caps = gst_caps_intersect (accepted_caps, template_caps);
ret = gst_caps_can_intersect (caps, modified_caps);
ret = gst_caps_can_intersect (caps, accepted_caps);
GST_DEBUG_OBJECT (pad, "%saccepted caps %" GST_PTR_FORMAT,
(ret ? "" : "not "), caps);
gst_caps_unref (accepted_caps);
gst_caps_unref (modified_caps);
if (had_current_caps)
gst_caps_unref (template_caps);
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment