From: Mark Nauwelaerts Date: Sat, 5 Mar 2016 18:48:45 +0000 (+0100) Subject: glfilter: handle some more unfixed fields when fixating caps X-Git-Tag: 1.16.2~955^2~407 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99f9d4ccc7cc1a52791c9ae3ab94211e94b8a05b;p=platform%2Fupstream%2Fgst-plugins-base.git glfilter: handle some more unfixed fields when fixating caps --- diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 59c8508..2c518e3 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -336,7 +336,13 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, GST_DEBUG_OBJECT (bt, "height is fixed (%d)", h); if (!gst_value_is_fixed (to_par)) { - gst_value_set_fraction (&tpar, 1, 1); + /* (shortcut) copy-paste (??) of videoscale seems to aim for 1/1, + * so let's make it so ... + * especially if following code assumes fixed */ + GST_DEBUG_OBJECT (bt, "fixating to_par to 1x1"); + gst_structure_fixate_field_nearest_fraction (outs, + "pixel-aspect-ratio", 1, 1); + to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); } /* PAR is fixed, choose the height that is nearest to the @@ -363,7 +369,13 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, GST_DEBUG_OBJECT (bt, "width is fixed (%d)", w); if (!gst_value_is_fixed (to_par)) { - gst_value_set_fraction (&tpar, 1, 1); + /* (shortcut) copy-paste (??) of videoscale seems to aim for 1/1, + * so let's make it so ... + * especially if following code assumes fixed */ + GST_DEBUG_OBJECT (bt, "fixating to_par to 1x1"); + gst_structure_fixate_field_nearest_fraction (outs, + "pixel-aspect-ratio", 1, 1); + to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); } /* PAR is fixed, choose the height that is nearest to the