[vlc-commits] avcodec: check i_samples_delay before rewinding date
Ilkka Ollakka
git at videolan.org
Sat Nov 9 18:20:26 CET 2013
vlc/vlc-2.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Nov 3 10:43:40 2013 +0200| [5fc25faa5296428ab1edacabd4f4e4e1d72f4d1f] | committer: Jean-Baptiste Kempf
avcodec: check i_samples_delay before rewinding date
(cherry picked from commit af4893152f8cbaf8ceee85d13dc7fa295e8df9da)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=5fc25faa5296428ab1edacabd4f4e4e1d72f4d1f
---
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 ef92e42..fea16c3 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1132,7 +1132,8 @@ static block_t *EncodeAudio( encoder_t *p_enc, block_t *p_aout_buf )
{
date_Set( &p_sys->buffer_date, p_aout_buf->i_dts );
/* take back amount we have leftover from previous buffer*/
- date_Decrement( &p_sys->buffer_date, p_sys->i_samples_delay );
+ if( p_sys->i_samples_delay > 0 )
+ date_Decrement( &p_sys->buffer_date, p_sys->i_samples_delay );
}
// Check if we have enough samples in delay_buffer and current p_aout_buf to fill frame
More information about the vlc-commits
mailing list