mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
741d23f06c
commit
909f494a5a
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue