[vlc-devel] [PATCH 1/2] decoder: Give packetizer aspect ratio to decoder.

Julian Scheel julian at jusst.de
Mon Sep 9 19:24:55 CEST 2013


Am 06.09.2013 12:42, schrieb Jean-Baptiste Kempf:
> On 06 Sep, Julian Scheel wrote :
>> When the packetizer detects a valid pixel aspect ratio this should be
>> forwarded to the decoders input format. This is helpful for decoder modules
>> which do not detect the aspect ratio on their own.
>>
>> Signed-off-by: Julian Scheel <julian at jusst.de>
>> ---
>>   src/input/decoder.c | 12 ++++++++++++
>>   1 file changed, 12 insertions(+)
>>
>> diff --git a/src/input/decoder.c b/src/input/decoder.c
>> index 9221426..d9283e3 100644
>> --- a/src/input/decoder.c
>> +++ b/src/input/decoder.c
>> @@ -1823,6 +1823,18 @@ static void DecoderProcessVideo( decoder_t *p_dec, block_t *p_block, bool b_flus
>>                   es_format_Clean( &p_dec->fmt_in );
>>                   es_format_Copy( &p_dec->fmt_in, &p_packetizer->fmt_out );
>>               }
>> +
>> +            if( p_packetizer->fmt_out.video.i_sar_num > 0 &&
>> +                    p_packetizer->fmt_out.video.i_sar_den > 0 &&
>> +                    (p_dec->fmt_in.video.i_sar_num == 0 ||
>> +                     p_dec->fmt_in.video.i_sar_den == 0) )
>> +            {
>> +                p_dec->fmt_in.video.i_sar_num =
>> +                    p_packetizer->fmt_out.video.i_sar_num;
>> +                p_dec->fmt_in.video.i_sar_den=
>> +                    p_packetizer->fmt_out.video.i_sar_den;
>> +            }
>> +
>
> Is it not possible to use es_format_copy or similar?

My idea was to avoid overwriting any other information but the aspect 
ratio. If noone sees an issue with copying the whole format 
es_format_copy could be used.

-Julian




More information about the vlc-devel mailing list