From 3edf390b4c6bd4ee9ad40fb3b6705992b2b0b7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 25 Aug 2020 12:56:21 +0300 Subject: [PATCH] videorate/videoscale/audioresample: Ensure that the caps returned from fixate_caps() are actually fixated If there is some other field than the ones we care about left and not fixated yet then basetransform will just error out. So instead just pass the result through gst_caps_fixate() in the very end. Part-of: --- gst/audioresample/gstaudioresample.c | 2 +- gst/videorate/gstvideorate.c | 2 +- gst/videoscale/gstvideoscale.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index de8bd80f70..cd9e329fd2 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -362,7 +362,7 @@ gst_audio_resample_fixate_caps (GstBaseTransform * base, s = gst_caps_get_structure (othercaps, 0); gst_structure_fixate_field_nearest_int (s, "rate", rate); - return othercaps; + return gst_caps_fixate (othercaps); } static GstStructure * diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index ea99e00ee4..6ef926c123 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -535,7 +535,7 @@ gst_video_rate_fixate_caps (GstBaseTransform * trans, if ((par = gst_structure_get_value (s, "pixel-aspect-ratio"))) gst_structure_fixate_field_nearest_fraction (s, "pixel-aspect-ratio", 1, 1); - return othercaps; + return gst_caps_fixate (othercaps); } static gboolean diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 198a767747..83377aa389 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -1149,6 +1149,8 @@ gst_video_scale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, } done: + othercaps = gst_caps_fixate (othercaps); + GST_DEBUG_OBJECT (base, "fixated othercaps to %" GST_PTR_FORMAT, othercaps); if (from_par == &fpar)