[vlc-devel] [PATCH] vpx: decoder: Set i_sar_num and i_sar_den
Tristan Matthews
tmatth at videolan.org
Tue Jan 24 02:23:14 CET 2017
Hi,
On Sun, Jan 22, 2017 at 8:56 PM, Andrew Clayton
<andrew at digital-domain.net> wrote:
> Since commit 0bceaf96 ("vpx: increase decoder capability (refs #16836)")
> made libvpx the default this has broken the default playback of VP8/9
> video where the sample aspect ratio (SAR) is not equal to one. e.g
>
> Given a video like
>
> vp8, yuv420p, 720x576, SAR 64:45 DAR 16:9, 25 fps
>
> which is meant to be played back at 1024x576, will playback at 720x576
> due to not passing the SAR value through.
>
> I have many such videos as encoded from PAL DVD's. Another example is
>
> vp8, yuv420p, 720x576, SAR 16:15 DAR 4:3, 25 fps
>
> this should actually playback at 768x576.
>
> So this commit simply passes the SAR values through. Without this
> passing --codec=ffmpeg or --codec=avcodec also restores previous
> behaviour.
>
> Signed-off-by: Andrew Clayton <andrew at digital-domain.net>
> ---
> modules/codec/vpx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/modules/codec/vpx.c b/modules/codec/vpx.c
> index fa494d8..db53164 100644
> --- a/modules/codec/vpx.c
> +++ b/modules/codec/vpx.c
> @@ -325,6 +325,8 @@ static int OpenDecoder(vlc_object_t *p_this)
> dec->pf_decode_video = Decode;
>
> dec->fmt_out.i_cat = VIDEO_ES;
> + dec->fmt_out.video.i_sar_num = dec->fmt_in.video.i_sar_num;
> + dec->fmt_out.video.i_sar_den = dec->fmt_in.video.i_sar_den;
I think you want to check that dec->fmt_in.video.i_sar_{num, den} are
greater than 0 before setting these.
Best,
Tristan
> dec->fmt_out.video.i_width = dec->fmt_in.video.i_width;
> dec->fmt_out.video.i_height = dec->fmt_in.video.i_height;
>
> --
> 2.7.4
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list