[vlc-devel] [PATCH 1/3] decoder: forward the source colorimetry if the decoder doesn't set it

Steve Lhomme robux4 at ycbcr.xyz
Tue Feb 19 08:33:05 CET 2019


On 18/02/2019 17:45, Rémi Denis-Courmont wrote:
> Le maanantaina 18. helmikuuta 2019, 17.56.40 EET Steve Lhomme a écrit :
>> ---
>>   src/input/decoder_helpers.c | 16 ++++++++++++++++
>>   1 file changed, 16 insertions(+)
>>
>> diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
>> index 3cc02de8d6..a019a540df 100644
>> --- a/src/input/decoder_helpers.c
>> +++ b/src/input/decoder_helpers.c
>> @@ -79,6 +79,22 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
>>                     dec->cbs->video.format_update == NULL) )
>>           return -1;
>>
>> +    if ( dec->fmt_in.video.color_range != COLOR_RANGE_UNDEF &&
>> +         dec->fmt_out.video.color_range == COLOR_RANGE_UNDEF )
>> +        dec->fmt_out.video.color_range = dec->fmt_in.video.color_range;
> This is equivalent and simpler:
>
> +    if (dec->fmt_out.video.color_range == COLOR_RANGE_UNDEF)
> +        dec->fmt_out.video.color_range = dec->fmt_in.video.color_range;
>
> The only Q is whether fmt_out should be mangled in the back of the decoder.
> That seems sketchy.
>

Also as a more general remark I think it's better if there's no 
uninitialized values in the video format coming out of the decoder. 
Right now the responsibility of cleaning the values before use is left 
to each receiver of the pictures but it seems wrong. Especially since 
we're currently losing metadata from the decoder input and those 
receivers have no way to know.


More information about the vlc-devel mailing list