Module: libav
Branch: release/11
Commit: 1ad3da32b8ad818d187bc66990c04e96b0b21f2c

Author:    Michael Niedermayer <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Tue Oct 27 13:47:12 2015 +0100

opus: Buffer the samples from the correct offset

When not all the opus stream have the same amount of decoded samples
process the least amount and store what is left from the other streams.

Bug-Id: 909
CC: [email protected]

Signed-off-by: Michael Niedermayer <[email protected]>
Signed-off-by: Luca Barbato <[email protected]>

---

 libavcodec/opusdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 80a80b4..878a439 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -567,8 +567,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void 
*data,
         if (buffer_samples) {
             float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : 
(float*)frame->extended_data[0],
                               c->out[2 * i + 1] ? c->out[2 * i + 1] : 
(float*)frame->extended_data[0] };
-            buf[0] += buffer_samples;
-            buf[1] += buffer_samples;
+            buf[0] += decoded_samples;
+            buf[1] += decoded_samples;
             ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, 
buffer_samples);
             if (ret < 0)
                 return ret;

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to