[vlc-commits] avcodec: check i_samples_delay before rewinding date
Ilkka Ollakka
git at videolan.org
Sun Nov 3 11:35:38 CET 2013
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Nov 3 10:43:40 2013 +0200| [af4893152f8cbaf8ceee85d13dc7fa295e8df9da] | committer: Ilkka Ollakka
avcodec: check i_samples_delay before rewinding date
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=af4893152f8cbaf8ceee85d13dc7fa295e8df9da
---
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 8d1a790..a4c0d53 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -1140,7 +1140,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