summaryrefslogtreecommitdiff
path: root/libavcodec/aacdec.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-04 15:35:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-06-07 10:14:46 +0200
commita188108ebf28ebac9d2b8fc7d5b391aef45698b3 (patch)
treebee141dc70242ed9de0748261597c8d1c575a44c /libavcodec/aacdec.c
parent677c804aa3a78d61b21e6423165a252846c20f0e (diff)
aac: Support channel configurations 11 and 12
These are defined in ISO/IEC 14496-3:2009/PDAM 4 for 6.1 and 7.1. It also defines another 7.1 layout with configuration 14, that one is not added here for now. 11: 3/3.1 FC FL+FR BL+BR BC LFE 12: 3/2/2.1 FC FL+FR SiL+SiR BL+BR LFE Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r--libavcodec/aacdec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 74628d6b14..9d14357086 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -507,7 +507,8 @@ static int set_default_channel_config(AVCodecContext *avctx,
int *tags,
int channel_config)
{
- if (channel_config < 1 || channel_config > 7) {
+ if (channel_config < 1 || (channel_config > 7 && channel_config < 11) ||
+ channel_config > 12) {
av_log(avctx, AV_LOG_ERROR,
"invalid default channel configuration (%d)\n",
channel_config);
@@ -564,11 +565,19 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
/* For indexed channel configurations map the channels solely based
* on position. */
switch (ac->oc[1].m4ac.chan_config) {
+ case 12:
case 7:
if (ac->tags_mapped == 3 && type == TYPE_CPE) {
ac->tags_mapped++;
return ac->tag_che_map[TYPE_CPE][elem_id] = ac->che[TYPE_CPE][2];
}
+ case 11:
+ if (ac->tags_mapped == 2 &&
+ ac->oc[1].m4ac.chan_config == 11 &&
+ type == TYPE_SCE) {
+ ac->tags_mapped++;
+ return ac->tag_che_map[TYPE_SCE][elem_id] = ac->che[TYPE_SCE][1];
+ }
case 6:
/* Some streams incorrectly code 5.1 audio as
* SCE[0] CPE[0] CPE[1] SCE[1]
@@ -2748,7 +2757,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
ac->tags_mapped = 0;
- if (chan_config < 0 || chan_config >= 8) {
+ if (chan_config < 0 || (chan_config >= 8 && chan_config < 11) || chan_config >= 13) {
avpriv_request_sample(avctx, "Unknown ER channel configuration %d",
chan_config);
return AVERROR_INVALIDDATA;