[vlc-devel] [PATCH] avcodec audio decoder: use libavcodec pts/dts
Rémi Denis-Courmont
remi at remlab.net
Fri Jul 26 21:00:08 CEST 2013
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?
> + if (frame.nb_samples)
> + p_block->i_nb_samples = frame.nb_samples;
> }
>
> if( ctx->channels <= 0 || ctx->channels > 8 || ctx->sample_rate <= 0 )
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list