[vlc-devel] [PATCH] [RFC] avcodec: recover the source visible area when going through the decoder

Steve Lhomme robux4 at ycbcr.xyz
Mon Apr 16 09:46:23 CEST 2018


Le 16/04/2018 à 09:33, Steve Lhomme a écrit :
> Fixes #12767

It may for for the case we want the container to overwrite what the 
decoder finds. But if the container is wrong then the display will be 
wrong. Not sure if that's a common case.

If the container/packetizer doesn't set a value then there's no change.

> ---
>   modules/codec/avcodec/video.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
> index b505d34846..b77f3d85c4 100644
> --- a/modules/codec/avcodec/video.c
> +++ b/modules/codec/avcodec/video.c
> @@ -165,8 +165,8 @@ static int lavc_GetVideoFormat(decoder_t *dec, video_format_t *restrict fmt,
>   
>       fmt->i_width = width;
>       fmt->i_height = height;
> -    fmt->i_visible_width = ctx->width;
> -    fmt->i_visible_height = ctx->height;
> +    fmt->i_visible_width = dec->fmt_in.video.i_visible_width ? : (unsigned) ctx->width;
> +    fmt->i_visible_height = dec->fmt_in.video.i_visible_height ? : (unsigned) ctx->height;
>   
>       /* If an aspect-ratio was specified in the input format then force it */
>       if (dec->fmt_in.video.i_sar_num > 0 && dec->fmt_in.video.i_sar_den > 0)



More information about the vlc-devel mailing list