[vlc-devel] [PATCH 2/3] decoder: do video_format_AdjustColorSpace() for all formats we output

Rémi Denis-Courmont remi at remlab.net
Wed Jun 5 22:29:56 CEST 2019


Le keskiviikkona 5. kesäkuuta 2019, 18.50.26 EEST Steve Lhomme a écrit :
> The decoder can still update after it was set after a further
> decoder_UpdateVideoFormat() call.
> 
> So no video format without colorimetry can get out of the decoder.
> ---
>  src/input/decoder_helpers.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
> index d42ee64cb5..853ccc14f6 100644
> --- a/src/input/decoder_helpers.c
> +++ b/src/input/decoder_helpers.c
> @@ -93,6 +93,8 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
>      if ( fmt_out.chroma_location == CHROMA_LOCATION_UNDEF )
>          fmt_out.chroma_location = dec->fmt_in.video.chroma_location;
> 
> +    video_format_AdjustColorSpace( &fmt_out );
> +
>      video_format_t original = dec->fmt_out.video;
>      dec->fmt_out.video = fmt_out;

Not sure if this preexisting code, that the patch seems to rely on, is valid 
at all. It depends if dec->fmt_out is read-only/shared for 
decoder_UpdateVideoFormat() (and potentially other threads inside the decoder) 
or read-write/exclusive.

>      int err = dec->cbs->video.format_update( dec );


-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list