comparison aacenc.c @ 11687:855ec3d8a62b libavcodec

Error out when too many bits per frame are requested.
author alexc
date Thu, 06 May 2010 20:35:10 +0000
parents 7dd2a45249a9
children 15e7486e5c7a
comparison
equal deleted inserted replaced
11686:41a083a2527a 11687:855ec3d8a62b
170 av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels); 170 av_log(avctx, AV_LOG_ERROR, "Unsupported number of channels: %d\n", avctx->channels);
171 return -1; 171 return -1;
172 } 172 }
173 if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) { 173 if (avctx->profile != FF_PROFILE_UNKNOWN && avctx->profile != FF_PROFILE_AAC_LOW) {
174 av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile); 174 av_log(avctx, AV_LOG_ERROR, "Unsupported profile %d\n", avctx->profile);
175 return -1;
176 }
177 if (1024.0 * avctx->bit_rate / avctx->sample_rate > 6144 * avctx->channels) {
178 av_log(avctx, AV_LOG_ERROR, "Too many bits per frame requested\n");
175 return -1; 179 return -1;
176 } 180 }
177 s->samplerate_index = i; 181 s->samplerate_index = i;
178 182
179 dsputil_init(&s->dsp, avctx); 183 dsputil_init(&s->dsp, avctx);