# HG changeset patch # User alexc # Date 1242237478 0 # Node ID 61c62ab2218f7aaa0b4f5e2480a5e86dcd5d88bf # Parent 9592af8b6ce0fc8fa657965f12efbb17e1352132 Allow parsing and decoding of ADTS AAC files with channel config = 0 diff -r 9592af8b6ce0 -r 61c62ab2218f aac.c --- a/aac.c Wed May 13 14:11:11 2009 +0000 +++ b/aac.c Wed May 13 17:57:58 2009 +0000 @@ -162,9 +162,6 @@ AVCodecContext *avctx = ac->avccontext; int i, type, channels = 0; - if(!memcmp(che_pos, new_che_pos, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0]))) - return 0; /* no change */ - memcpy(che_pos, new_che_pos, 4 * MAX_ELEM_ID * sizeof(new_che_pos[0][0])); /* Allocate or free elements depending on if they are in the @@ -458,9 +455,6 @@ if(output_configure(ac, ac->che_pos, new_che_pos, 1)) return -1; ac->m4ac.sample_rate = avccontext->sample_rate; - } else { - ff_log_missing_feature(ac->avccontext, "Implicit channel configuration is", 0); - return -1; } avccontext->sample_fmt = SAMPLE_FMT_S16; diff -r 9592af8b6ce0 -r 61c62ab2218f aac_ac3_parser.c --- a/aac_ac3_parser.c Wed May 13 14:11:11 2009 +0000 +++ b/aac_ac3_parser.c Wed May 13 17:57:58 2009 +0000 @@ -84,8 +84,10 @@ avctx->codec_id == CODEC_ID_EAC3)))) { avctx->channels = avctx->request_channels; } else { + if (avctx->codec_id != CODEC_ID_AAC || s->channels) { avctx->channels = s->channels; avctx->channel_layout = s->channel_layout; + } } avctx->bit_rate = s->bit_rate; avctx->frame_size = s->samples; diff -r 9592af8b6ce0 -r 61c62ab2218f aac_parser.c --- a/aac_parser.c Wed May 13 14:11:11 2009 +0000 +++ b/aac_parser.c Wed May 13 17:57:58 2009 +0000 @@ -44,9 +44,6 @@ skip_bits1(gbc); /* private_bit */ ch = get_bits(gbc, 3); /* channel_configuration */ - if(!ff_mpeg4audio_channels[ch]) - return AAC_AC3_PARSE_ERROR_CHANNEL_CFG; - skip_bits1(gbc); /* original/copy */ skip_bits1(gbc); /* home */