Commit 68e57cde authored by Martin Storsjö's avatar Martin Storsjö

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: 's avatarMartin Storsjö <martin@martin.st>
parent 886e1b36
...@@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, ...@@ -1393,10 +1393,10 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
if (err) if (err)
for (ch = 0; ch < s->out_channels; ch++) for (ch = 0; ch < s->out_channels; ch++)
memcpy(s->outptr[channel_map[ch]], output[ch], 1024); 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]]; 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 */ /* keep last block for error concealment in next frame */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment