[vlc-devel] [PATCH] When the demuxer sets dimensions use them rather than the codec values

Rémi Denis-Courmont remi at remlab.net
Thu Mar 5 16:26:34 CET 2015


Le 2015-03-05 18:04, Steve Lhomme a écrit :
> Doesn't fix #13982 as most video_output don't handle the cropping
> values attached to decoded planes properly.
>
> Direct3D, DirectDraw and OpenGL create bleeding as in
> http://i.imgur.com/MzDLw9O.png
> Direct2D or GDI create green bars.
> ---
>  src/input/decoder.c | 30 ++++++++++++++++--------------
>  1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 451024b..cc897fb 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -2047,23 +2047,25 @@ static int vout_update_format( decoder_t 
> *p_dec )
>              }
>          }
>
> -        if( !fmt.i_visible_width || !fmt.i_visible_height )
> +        if( p_dec->fmt_in.video.i_visible_width &&
> +            p_dec->fmt_in.video.i_visible_height )
>          {
> -            if( p_dec->fmt_in.video.i_visible_width &&
> -                p_dec->fmt_in.video.i_visible_height )
> +            if( fmt.i_visible_width && fmt.i_visible_height )
>              {
> -                fmt.i_visible_width  = 
> p_dec->fmt_in.video.i_visible_width;
> -                fmt.i_visible_height = 
> p_dec->fmt_in.video.i_visible_height;
> -                fmt.i_x_offset       = 
> p_dec->fmt_in.video.i_x_offset;
> -                fmt.i_y_offset       = 
> p_dec->fmt_in.video.i_y_offset;
> -            }
> -            else
> -            {
> -                fmt.i_visible_width  = fmt.i_width;
> -                fmt.i_visible_height = fmt.i_height;
> -                fmt.i_x_offset       = 0;
> -                fmt.i_y_offset       = 0;
> +                fmt.i_width  = fmt.i_visible_width;
> +                fmt.i_height = fmt.i_visible_height;

No. Changing the physical width and height breaks alignment and padding 
assumptions in the decoders.

At best, this will force indirect rendering for CPU decoding, and break 
GPU decoding. At worst, it will just crash.

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list