Commit 8900c8b4 authored by alexc's avatar alexc

Allow parsing and decoding of ADTS AAC files with channel config = 0


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18815 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 570a888a
...@@ -162,9 +162,6 @@ static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_ ...@@ -162,9 +162,6 @@ static int output_configure(AACContext *ac, enum ChannelPosition che_pos[4][MAX_
AVCodecContext *avctx = ac->avccontext; AVCodecContext *avctx = ac->avccontext;
int i, type, channels = 0; 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])); 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 /* Allocate or free elements depending on if they are in the
...@@ -458,9 +455,6 @@ static av_cold int aac_decode_init(AVCodecContext * avccontext) { ...@@ -458,9 +455,6 @@ static av_cold int aac_decode_init(AVCodecContext * avccontext) {
if(output_configure(ac, ac->che_pos, new_che_pos, 1)) if(output_configure(ac, ac->che_pos, new_che_pos, 1))
return -1; return -1;
ac->m4ac.sample_rate = avccontext->sample_rate; 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; avccontext->sample_fmt = SAMPLE_FMT_S16;
......
...@@ -84,8 +84,10 @@ get_next: ...@@ -84,8 +84,10 @@ get_next:
avctx->codec_id == CODEC_ID_EAC3)))) { avctx->codec_id == CODEC_ID_EAC3)))) {
avctx->channels = avctx->request_channels; avctx->channels = avctx->request_channels;
} else { } else {
if (avctx->codec_id != CODEC_ID_AAC || s->channels) {
avctx->channels = s->channels; avctx->channels = s->channels;
avctx->channel_layout = s->channel_layout; avctx->channel_layout = s->channel_layout;
}
} }
avctx->bit_rate = s->bit_rate; avctx->bit_rate = s->bit_rate;
avctx->frame_size = s->samples; avctx->frame_size = s->samples;
......
...@@ -44,9 +44,6 @@ int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) ...@@ -44,9 +44,6 @@ int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr)
skip_bits1(gbc); /* private_bit */ skip_bits1(gbc); /* private_bit */
ch = get_bits(gbc, 3); /* channel_configuration */ 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); /* original/copy */
skip_bits1(gbc); /* home */ skip_bits1(gbc); /* home */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment