From d28dfa2d425ce5e5db38924577b3d86dcee40523 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 17 Dec 2012 01:35:14 +0100 Subject: [PATCH] ac3dec: fix outptr increment. Fixes decoding regression Signed-off-by: Michael Niedermayer --- libavcodec/ac3dec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 0bc1adafdd..4ca735f536 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1402,9 +1402,8 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, memcpy(((float*)s->frame.data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024); for (ch = 0; ch < s->out_channels; ch++) { output[ch] = s->outptr[channel_map[ch]]; - } - for (ch = 0; ch < s->channels; ch++) { - s->outptr[ch] += AC3_BLOCK_SIZE; + if (!ch || channel_map[ch]) + s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE; } }