[vlc-commits] avcodec: missed AV_NOPTS_VALUE check

Ilkka Ollakka git at videolan.org
Sun Oct 20 16:19:10 CEST 2013


vlc/vlc-2.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sat Oct 19 13:47:23 2013 +0300| [5d7122a68077da8097aa092de8e76bb5ffb68396] | committer: Jean-Baptiste Kempf

avcodec: missed AV_NOPTS_VALUE check

(cherry picked from commit 6ea637534fe9d87f1e10001e8548f536883b9119)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=5d7122a68077da8097aa092de8e76bb5ffb68396
---

 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 7854584..dee617b 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1302,7 +1302,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