Skip to content
Snippets Groups Projects
Commit 6dcd8229 authored by Michael Niedermayer's avatar Michael Niedermayer Committed by Luca Barbato
Browse files

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: libav-stable@libav.org

Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: default avatarLuca Barbato <lu_zero@gentoo.org>
parent f3aff31e
No related branches found
No related tags found
No related merge requests found
...@@ -567,8 +567,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data, ...@@ -567,8 +567,8 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
if (buffer_samples) { if (buffer_samples) {
float *buf[2] = { c->out[2 * i + 0] ? c->out[2 * i + 0] : (float*)frame->extended_data[0], 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] }; c->out[2 * i + 1] ? c->out[2 * i + 1] : (float*)frame->extended_data[0] };
buf[0] += buffer_samples; buf[0] += decoded_samples;
buf[1] += buffer_samples; buf[1] += decoded_samples;
ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples); ret = av_audio_fifo_write(c->sync_buffers[i], (void**)buf, buffer_samples);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment