summaryrefslogtreecommitdiff
path: root/libavcodec/aacdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-10-21 09:41:40 +0000
committerAlex Converse <alex.converse@gmail.com>2012-02-28 21:38:16 -0800
commit956fb91e0333634aa25dcb5632c6e4e3769d05ee (patch)
tree93338fff4a270469f0c232ddd2e83e3b07fd329c /libavcodec/aacdec.c
parent2564f6e6d433ec9907dc4bf2f9e8ea252e83a635 (diff)
aacdec: Support stereo streams that erroneously signal predefined channel configuration 1 (mono).
[alex.converse@mgail.com] Move code to get_che() Update for AAC new channel configuration interface Only set chan_config if output_configure succeeds. Signed-off-by: Alex Converse <alex.converse@gmail.com>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r--libavcodec/aacdec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 340052e0c0..4f94f5f5c9 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -415,6 +415,20 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
if (!ac->m4ac.chan_config) {
return ac->tag_che_map[type][elem_id];
}
+ // Allow single CPE stereo files to be signalled with mono configuration.
+ if (!ac->tags_mapped && type == TYPE_CPE && ac->m4ac.chan_config == 1) {
+ uint8_t layout_map[MAX_ELEM_ID*4][3];
+ int layout_map_tags;
+
+ if (set_default_channel_config(ac->avctx, layout_map, &layout_map_tags,
+ 2) < 0)
+ return NULL;
+ if (output_configure(ac, layout_map, layout_map_tags,
+ 2, OC_TRIAL_FRAME) < 0)
+ return NULL;
+
+ ac->m4ac.chan_config = 2;
+ }
// For indexed channel configurations map the channels solely based on position.
switch (ac->m4ac.chan_config) {
case 7: