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

Rémi Denis-Courmont remi at remlab.net
Sun Jul 28 10:47:42 CEST 2013


Le samedi 27 juillet 2013 08:24:39 Rafaël Carré a écrit :
> 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.

You have never seen it happen does not imply that it cannot happen, or that it 
will not happen with future versions. Unless <avcodec.h> promises not to do 
such a thing, you cannot assume it will not.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list