diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-06-16 23:23:56 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-06-16 23:23:56 +0000 |
commit | aca490777f9da2a71b537874ed4e16105bb3df02 (patch) | |
tree | a1a9da0c2340096694a8e0498d3be79f7c5392d9 | |
parent | 8b470cc54200bc0f76c57565fee81ff110f11df0 (diff) | |
download | ffmpeg-aca490777f9da2a71b537874ed4e16105bb3df02.tar.gz |
Correct validity checks.
Originally committed as revision 13787 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/g726.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 385d6fde96..88f7cee380 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -324,14 +324,8 @@ static av_cold int g726_init(AVCodecContext * avctx) AVG726Context* c = (AVG726Context*)avctx->priv_data; unsigned int index= (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate - 2; - if ( - (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 && - avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) { - av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); - return -1; - } - if (avctx->sample_rate != 8000 && avctx->strict_std_compliance>FF_COMPLIANCE_INOFFICIAL) { - av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); + if (avctx->bit_rate % avctx->sample_rate && avctx->codec->encode) { + av_log(avctx, AV_LOG_ERROR, "Bitrate - Samplerate combination is invalid\n"); return -1; } if(avctx->channels != 1){ |