summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2016-03-05 19:48:45 +0100
committerMark Nauwelaerts <mnauw@users.sourceforge.net>2016-03-05 19:48:57 +0100
commit8d8c65b6d445eb999f6265dd268ae46ba3e0a0d7 (patch)
tree4a9837ba1d2bf42c871aa1c2e28e40c726e30c71
parentdbefd2f8a8a176d7c3b5c82fec745023b12f3fa2 (diff)
downloadgstreamer-plugins-bad-8d8c65b6d445eb999f6265dd268ae46ba3e0a0d7.tar.gz
glfilter: handle some more unfixed fields when fixating caps
-rw-r--r--gst-libs/gst/gl/gstglfilter.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c
index 59c850838..2c518e314 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