diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-10-27 13:47:12 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-10-28 16:59:57 +0100 |
commit | 6dcd82290438eb810936de4febd0558b38a08ec5 (patch) | |
tree | 965c54d3c0f79ad93090ca4ecc71d94c04cc6a74 /libavcodec/opusdec.c | |
parent | f3aff31e5f66a4f1c4e34ce4944f4a402aca61ed (diff) | |
download | ffmpeg-6dcd82290438eb810936de4febd0558b38a08ec5.tar.gz |
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: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/opusdec.c')
-rw-r--r-- | libavcodec/opusdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index acae6e1f66..919e5e3303 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; |