# HG changeset patch # User michael # Date 1213658636 0 # Node ID ecb7071103afae9511c5990e1505d68c32595dce # Parent bb24d15211a4b11d61a72cde0c980d103f6cb3a3 Correct validity checks. diff -r bb24d15211a4 -r ecb7071103af g726.c --- a/g726.c Mon Jun 16 23:20:11 2008 +0000 +++ b/g726.c Mon Jun 16 23:23:56 2008 +0000 @@ -324,14 +324,8 @@ 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){