plugins: handle pixel-aspect-ratio with value 0/1

When downstream negotiates a pixel-aspect-ratio of 0/1, the
calculations for resizing and formatting in vaapipostproc and
vaapisink, respectively, failed, and thus the pipeline.

This patch handles this situation by converting p-a-r of 0/1 to
1/1. This is how other sinks, such as glimagesink, work.

https://bugzilla.gnome.org/show_bug.cgi?id=781759
This commit is contained in:
Víctor Manuel Jáquez Leal 2017-04-26 15:48:01 +02:00
parent cce5ce4a9d
commit 4820d2d09d
2 changed files with 4 additions and 0 deletions

View file

@ -176,6 +176,8 @@ _fixate_frame_size (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
gint num, den;
from_par_n = GST_VIDEO_INFO_PAR_N (vinfo);
if (from_par_n == 0)
from_par_n = 1;
from_par_d = GST_VIDEO_INFO_PAR_D (vinfo);
from_w = GST_VIDEO_INFO_WIDTH (vinfo);
from_h = GST_VIDEO_INFO_HEIGHT (vinfo);

View file

@ -1334,6 +1334,8 @@ gst_vaapisink_set_caps (GstBaseSink * base_sink, GstCaps * caps)
sink->video_height = GST_VIDEO_INFO_HEIGHT (vip);
sink->video_par_n = GST_VIDEO_INFO_PAR_N (vip);
sink->video_par_d = GST_VIDEO_INFO_PAR_D (vip);
if (sink->video_par_n == 0)
sink->video_par_n = 1;
GST_DEBUG ("video pixel-aspect-ratio %d/%d",
sink->video_par_n, sink->video_par_d);