summaryrefslogtreecommitdiff
path: root/libavcodec/aacenc.c
diff options
context:
space:
mode:
authorNathan Caldwell <saintdev@gmail.com>2011-07-23 01:19:34 -0600
committerAlex Converse <alex.converse@gmail.com>2011-08-13 19:37:38 -0700
commit51a1d4d94afe536b46c96299f4b50ca26e471fef (patch)
tree67f9aaf872d0ee0e946025d760c3f13d67548f69 /libavcodec/aacenc.c
parent3304a1e69a8a050eb66d2304acd2d01354fa1aac (diff)
downloadffmpeg-51a1d4d94afe536b46c96299f4b50ca26e471fef.tar.gz
aacenc: Fix a segfault with grouped psymodel.
10l: Forgot about TYPE_LFE being after TYPE_CPE. Which causes a segfault when encoding 5.1
Diffstat (limited to 'libavcodec/aacenc.c')
-rw-r--r--libavcodec/aacenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 9e876ff5dc..5a1fc94eb5 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -165,6 +165,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
AACEncContext *s = avctx->priv_data;
int i;
const uint8_t *sizes[2];
+ uint8_t grouping[AAC_MAX_CHANNELS];
int lengths[2];
avctx->frame_size = 1024;
@@ -210,7 +211,9 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
sizes[1] = swb_size_128[i];
lengths[0] = ff_aac_num_swb_1024[i];
lengths[1] = ff_aac_num_swb_128[i];
- ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], &s->chan_map[1]);
+ for (i = 0; i < s->chan_map[0]; i++)
+ grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
+ ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping);
s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[2];