aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-07-11 16:39:23 +0300
committerMartin Storsjö <martin@martin.st>2013-07-13 19:06:52 +0300
commit031be5b41b54c3b666f31d83fe3ad41c194af8c5 (patch)
tree892365da018870e0338fc77777281b251b55986b /libavcodec
parent68e57cde68f3da4c557ca15491fda74d1ea6321e (diff)
downloadffmpeg-031be5b41b54c3b666f31d83fe3ad41c194af8c5.tar.gz
ac3dec: Consistently use AC3_BLOCK_SIZE and sizeof
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3dec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 01da328d56..512d54b822 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1370,7 +1370,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) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return ret;
@@ -1392,7 +1392,7 @@ 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);
+ memcpy(s->outptr[channel_map[ch]], 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->channels; ch++)
@@ -1401,7 +1401,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;