[FFmpeg-cvslog] r13787 - trunk/libavcodec/g726.c

michael subversion
Tue Jun 17 01:23:56 CEST 2008


Author: michael
Date: Tue Jun 17 01:23:56 2008
New Revision: 13787

Log:
Correct validity checks.


Modified:
   trunk/libavcodec/g726.c

Modified: trunk/libavcodec/g726.c
==============================================================================
--- trunk/libavcodec/g726.c	(original)
+++ trunk/libavcodec/g726.c	Tue Jun 17 01:23:56 2008
@@ -324,14 +324,8 @@ static av_cold int g726_init(AVCodecCont
     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){




More information about the ffmpeg-cvslog mailing list