[vlc-devel] [PATCH] Preserve offsets set by source decoder

Laurent Aimar fenrir at elivagar.org
Thu Oct 6 10:46:48 CEST 2011


On Thu, Oct 06, 2011 at 05:25:48AM +0200, Stephan Krempel wrote:
> * In function vout_new_buffer offsets that are set in
>   p_dec->p_owner->video before got lost.
> 
> * Fixes problem with matroska clipping feature (#4600)
> 
> ---
>  src/input/decoder.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index efee194..72bdaa2 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -2360,6 +2360,12 @@ static picture_t *vout_new_buffer( decoder_t
> *p_dec ) }
>          }
> 
> +        if( !fmt.i_x_offset || !fmt.i_y_offset )
> +        {
> +                fmt.i_x_offset  = p_dec->fmt_in.video.i_x_offset;
> +                fmt.i_y_offset = p_dec->fmt_in.video.i_y_offset;
> +        }

I think you should move it inside (without the test):
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 )
    {
        <here>
    }
}

otherwise you will override what a decoder set (ex: theora with ogg).

Regards,

-- 
fenrir




More information about the vlc-devel mailing list