On Fri, Jul 29, 2011 at 3:24 PM, Alex Converse <[email protected]> wrote:
> On Fri, Jul 29, 2011 at 1:58 PM, Nathan Caldwell <[email protected]> wrote:
>> 10l: Forgot about TYPE_LFE being after TYPE_CPE. Which causes a
>> segfault when encoding 5.1
>> ---
>>  libavcodec/aacenc.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
>> index 9e876ff..e74af0b 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[6];
>
> Is there an appropriate define that can be used here?

AAC_MAX_CHANNELS (which really should be renamed). Not strictly
correct, but close enough.


-- 
-Nathan Caldwell
From 6ff648533111a84c167b2ac3431f1f8da00f429e Mon Sep 17 00:00:00 2001
From: Nathan Caldwell <[email protected]>
Date: Sat, 23 Jul 2011 01:19:34 -0600
Subject: [PATCH 1/2] aacenc: Fix a segfault with gouped psymodel.
To: libav development <[email protected]>

10l: Forgot about TYPE_LFE being after TYPE_CPE. Which causes a
segfault when encoding 5.1
---
 libavcodec/aacenc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 9e876ff..5a1fc94 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];
 
-- 
1.7.6

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to