Commit 909f494a authored by Thiago Santos's avatar Thiago Santos

videorate: fixate the pixel-aspect-ratio

If the pixel-aspect-ratio is not fixed, try to get it as close
to 1/1 as possible

https://bugzilla.gnome.org/show_bug.cgi?id=748635
parent 741d23f0
...@@ -478,6 +478,7 @@ gst_video_rate_fixate_caps (GstBaseTransform * trans, ...@@ -478,6 +478,7 @@ gst_video_rate_fixate_caps (GstBaseTransform * trans,
{ {
GstStructure *s; GstStructure *s;
gint num, denom; gint num, denom;
const GValue *par;
s = gst_caps_get_structure (caps, 0); s = gst_caps_get_structure (caps, 0);
if (G_UNLIKELY (!gst_structure_get_fraction (s, "framerate", &num, &denom))) if (G_UNLIKELY (!gst_structure_get_fraction (s, "framerate", &num, &denom)))
...@@ -488,6 +489,9 @@ gst_video_rate_fixate_caps (GstBaseTransform * trans, ...@@ -488,6 +489,9 @@ gst_video_rate_fixate_caps (GstBaseTransform * trans,
s = gst_caps_get_structure (othercaps, 0); s = gst_caps_get_structure (othercaps, 0);
gst_structure_fixate_field_nearest_fraction (s, "framerate", num, denom); gst_structure_fixate_field_nearest_fraction (s, "framerate", num, denom);
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 othercaps;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment