diff options
author | Thibault Saunier <tsaunier@igalia.com> | 2020-10-29 16:38:44 -0300 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-11-10 18:30:41 +0000 |
commit | df204bcab16877a7bcf84b49afeac8cf9faba9db (patch) | |
tree | 873070cc0bec4500b735558cbb9125d93e150d25 | |
parent | 82c90f80be447d464690e49ca068b54a058c91b7 (diff) | |
download | gstreamer-plugins-base-df204bcab16877a7bcf84b49afeac8cf9faba9db.tar.gz |
video-aggregator: Fix renegotiation when using convert pads
Since 23189c60f4cff998c7880e1768cee2f6d1b719d0 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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/907>
-rw-r--r-- | gst-libs/gst/video/gstvideoaggregator.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c index 6ea423e59..564a4a4c8 100644 --- a/gst-libs/gst/video/gstvideoaggregator.c +++ b/gst-libs/gst/video/gstvideoaggregator.c @@ -2496,10 +2496,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); @@ -2508,12 +2505,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); @@ -2533,15 +2526,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; } |