summaryrefslogtreecommitdiff
path: root/libavcodec/ac3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-07-14 12:10:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-07-14 12:10:38 +0200
commitac20ba35e37dac843c9692a02a63e6a6e3bcce36 (patch)
tree94637e759d3202b0092f968fc0df8d333cf2e732 /libavcodec/ac3dec.c
parent198e10b55cc908d9194d34013d212e4b5ff3b42f (diff)
parent031be5b41b54c3b666f31d83fe3ad41c194af8c5 (diff)
Merge commit '031be5b41b54c3b666f31d83fe3ad41c194af8c5'
* commit '031be5b41b54c3b666f31d83fe3ad41c194af8c5': ac3dec: Consistently use AC3_BLOCK_SIZE and sizeof Conflicts: libavcodec/ac3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
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 c4cf266b80..bfc81db26f 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1374,7 +1374,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
avctx->audio_service_type = AV_AUDIO_SERVICE_TYPE_KARAOKE;
/* get output buffer */
- frame->nb_samples = s->num_blocks * 256;
+ frame->nb_samples = s->num_blocks * AC3_BLOCK_SIZE;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
@@ -1395,7 +1395,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
}
if (err)
for (ch = 0; ch < s->out_channels; ch++)
- memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], 1024);
+ memcpy(((float*)frame->data[ch]) + AC3_BLOCK_SIZE*blk, output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
for (ch = 0; ch < s->out_channels; ch++)
output[ch] = s->outptr[channel_map[ch]];
for (ch = 0; ch < s->out_channels; ch++) {
@@ -1408,7 +1408,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data,
/* keep last block for error concealment in next frame */
for (ch = 0; ch < s->out_channels; ch++)
- memcpy(s->output[ch], output[ch], 1024);
+ memcpy(s->output[ch], output[ch], sizeof(**output) * AC3_BLOCK_SIZE);
*got_frame_ptr = 1;