[vlc-commits] avcodec: missed AV_NOPTS_VALUE check

Ilkka Ollakka git at videolan.org
Sat Oct 19 12:49:25 CEST 2013


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct 19 13:47:23 2013 +0300| [6ea637534fe9d87f1e10001e8548f536883b9119] | committer: Ilkka Ollakka

avcodec: missed AV_NOPTS_VALUE check

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6ea637534fe9d87f1e10001e8548f536883b9119
---

 modules/codec/avcodec/encoder.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 08d1122..89e2813 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1310,7 +1310,8 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
         p_aout_buf->p_buffer     += (p_sys->frame->nb_samples * p_sys->p_context->channels * p_sys->i_sample_bytes);
         p_aout_buf->i_buffer     -= (p_sys->frame->nb_samples * p_sys->p_context->channels * p_sys->i_sample_bytes);
         p_aout_buf->i_nb_samples -= p_sys->frame->nb_samples;
-        date_Increment( &p_sys->buffer_date, p_sys->frame->nb_samples );
+        if( likely( p_sys->frame->pts != AV_NOPTS_VALUE) )
+            date_Increment( &p_sys->buffer_date, p_sys->frame->nb_samples );
 
         p_block = block_Alloc( p_sys->i_buffer_out );
         av_init_packet( &packet );



More information about the vlc-commits mailing list