[vlc-commits] avcodec: audio: fix handling of block

Ilkka Ollakka git at videolan.org
Wed Sep 7 15:17:00 CEST 2016


vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Wed Sep  7 16:12:56 2016 +0300| [f581d0629378748e3303818afd682100c39a031e] | committer: Ilkka Ollakka

avcodec: audio: fix handling of block

regression introduced in d150b4bce968ffb97f387d4634b1d1d579259447
spotted by RĂ©mi Denis-Courmont

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

 modules/codec/avcodec/audio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 05d22cf..779e307 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -343,8 +343,8 @@ static block_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
         if( (unsigned)used > p_block->i_buffer )
             used = p_block->i_buffer;
 
-        p_block->p_buffer += used;
-        p_block->i_buffer -= used;
+        p_block->p_buffer += p_block->i_buffer;
+        p_block->i_buffer = 0;
     }
 
     if( ctx->channels <= 0 || ctx->channels > 8 || ctx->sample_rate <= 0 )



More information about the vlc-commits mailing list