summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-07-11 16:30:18 +0300
committerMartin Storsjö <martin@martin.st>2013-07-13 18:55:07 +0300
commit68e57cde68f3da4c557ca15491fda74d1ea6321e (patch)
tree186b2734bddf300277c88a25174005bf210536de /libavcodec/ac3dec.c
parent886e1b36f5044d3ceccbb01f64619acaf288fb7c (diff)
ac3dec: Increment channel pointers only once per channel
If the channel mapping map multiple output channels to one input channel, we should only increment the actual pointer once. Cc: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/ac3dec.c')
-rw-r--r--libavcodec/ac3dec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index abfd380b82..01da328d56 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
if (err)
for (ch = 0; ch < s->out_channels; ch++)
memcpy(s->outptr[channel_map[ch]], output[ch], 1024);
- for (ch = 0; ch < s->out_channels; ch++) {
+ for (ch = 0; ch < s->out_channels; ch++)
output[ch] = s->outptr[channel_map[ch]];
- s->outptr[channel_map[ch]] += AC3_BLOCK_SIZE;
- }
+ for (ch = 0; ch < s->channels; ch++)
+ s->outptr[ch] += AC3_BLOCK_SIZE;
}
/* keep last block for error concealment in next frame */