[vlc-devel] [PATCH] avcodec audio decoder: use libavcodec pts/dts

Rafaël Carré funman at videolan.org
Sat Jul 27 08:24:39 CEST 2013


Le 26/07/2013 21:00, Rémi Denis-Courmont a écrit :
> Le vendredi 26 juillet 2013 20:12:11 Rafaël Carré a écrit :
>> Fixes #5767
>> ---
>>  modules/codec/avcodec/audio.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
>> index d6c0313..7e4dbaf 100644
>> --- a/modules/codec/avcodec/audio.c
>> +++ b/modules/codec/avcodec/audio.c
>> @@ -295,6 +295,12 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t
>> **pp_block ) assert( p_block->i_buffer >= (unsigned)used );
>>          p_block->p_buffer += used;
>>          p_block->i_buffer -= used;
>> +        if (pkt.pts != AV_NOPTS_VALUE)
>> +            p_block->i_pts = pkt.pts;
>> +        if (pkt.dts != AV_NOPTS_VALUE)
>> +            p_block->i_dts = pkt.dts;
> 
> Won't there be a problem if there are values at some point and then not?

Probably but I've never seen that happen so I doubt we should wonder
about it.

>> +        if (frame.nb_samples)
>> +            p_block->i_nb_samples = frame.nb_samples;
>>      }
>>
>>      if( ctx->channels <= 0 || ctx->channels > 8 || ctx->sample_rate <= 0 )




More information about the vlc-devel mailing list