[vlc-devel] [PATCH 08/18] decoder: allow empty update_format callbacks in decoder owners

Steve Lhomme robux4 at ycbcr.xyz
Mon Oct 28 15:19:54 CET 2019


On 2019-10-28 13:51, Rémi Denis-Courmont wrote:
> It's still a bug to update the video format of a non-video ES. Patch is 
> excessively broad IMO

Not sure what you mean. The check on VIDEO_ES is still done. If it's 
called on non-video ES it will return -1 right away, just like before.

> Le 28 octobre 2019 14:41:25 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a 
> écrit :
> 
>     Many of them do trivial things that can be factorized in decoder_helpers.
>     ------------------------------------------------------------------------
>       src/input/decoder_helpers.c | 6 ++++--
>       1 file changed, 4 insertions(+), 2 deletions(-)
> 
>     diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
>     index ce32608c92c..87ab6bc560f 100644
>     --- a/src/input/decoder_helpers.c
>     +++ b/src/input/decoder_helpers.c
>     @@ -84,13 +84,15 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
>       int decoder_UpdateVideoOutput( decoder_t *dec, vlc_video_context *vctx_out )
>       {
>           vlc_assert( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs != NULL );
>     -    if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL ||
>     -                  dec->cbs->video.format_update == NULL) )
>     +    if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL) )
>               return -1;
>       
>           /* */
>           dec->fmt_out.video.i_chroma = dec->fmt_out.i_codec;
>       
>     +    if (dec->cbs->video.format_update == NULL)
>     +        return 0;
>     +
>           return dec->cbs->video.format_update( dec, vctx_out );
>       }
>       
> 
> 
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser 
> ma brièveté.
> 
> _______________________________________________
> 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