videorate/videoscale/audioresample: Ensure that the caps returned from fixate_caps...
authorSebastian Dröge <sebastian@centricular.com>
Tue, 25 Aug 2020 09:56:21 +0000 (12:56 +0300)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 26 Aug 2020 09:10:29 +0000 (09:10 +0000)
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/799>

gst/audioresample/gstaudioresample.c
gst/videorate/gstvideorate.c
gst/videoscale/gstvideoscale.c

index de8bd80..cd9e329 100644 (file)
@@ -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 *
index ea99e00..6ef926c 100644 (file)
@@ -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
index 198a767..83377aa 100644 (file)
@@ -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)