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
This commit is contained in:
Thiago Santos 2015-08-13 13:52:17 -03:00
parent 741d23f06c
commit 909f494a5a

View file

@ -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,
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;
} }