From: Alex Converse Date: Wed, 13 May 2009 17:57:58 +0000 (+0000) Subject: Allow parsing and decoding of ADTS AAC files with channel config = 0 X-Git-Tag: v0.6~4437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90350d73f8b6bb281d9028ad1adf4805a8bce717;p=platform%2Fupstream%2Flibav.git Allow parsing and decoding of ADTS AAC files with channel config = 0 Originally committed as revision 18815 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 5c3e2aa..5427d7c 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -162,9 +162,6 @@ static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_ 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 @@ static av_cold int aac_decode_init(AVCodecContext * avccontext) { 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 --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c index b51f176..90cbb95 100644 --- a/libavcodec/aac_ac3_parser.c +++ b/libavcodec/aac_ac3_parser.c @@ -84,8 +84,10 @@ get_next: 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 --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index ab8e092..30ce04d 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -44,9 +44,6 @@ int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) 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 */