]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Support 16K samplerate in Nellymoser.
authordiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 11 May 2009 19:21:49 +0000 (19:21 +0000)
committerdiego <diego@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Mon, 11 May 2009 19:21:49 +0000 (19:21 +0000)
patch by Alexander Chemeris, ipse.ffmpeg gmail.com

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18798 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/nellymoserdec.c
libavcodec/nellymoserenc.c

index cf4a916260cb64218f5f64514d03ffb241bb4da4..94f441890eb6353315a79d5e9ea9a9bbdccfc568 100644 (file)
@@ -170,6 +170,8 @@ static int decode_tag(AVCodecContext * avctx,
             blocks = 1; break;
         case 128:   // 11025Hz
             blocks = 2; break;
+        case 192:   // 16000Hz
+            blocks = 3; break;
         case 256:   // 22050Hz
             blocks = 4; break;
         case 512:   // 44100Hz
index 1cf0f14e19e5edddfe681a78d68081f7403a50c9..1bb6c666ab5a2d2f99fc51a88457fc8a9b16b097 100644 (file)
@@ -135,10 +135,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
         return -1;
     }
 
-    if (avctx->sample_rate != 8000 && avctx->sample_rate != 11025 &&
+    if (avctx->sample_rate != 8000 && avctx->sample_rate != 16000 &&
+        avctx->sample_rate != 11025 &&
         avctx->sample_rate != 22050 && avctx->sample_rate != 44100 &&
         avctx->strict_std_compliance >= FF_COMPLIANCE_NORMAL) {
-        av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 11025, 22050 and 44100 sample rate\n");
+        av_log(avctx, AV_LOG_ERROR, "Nellymoser works only with 8000, 16000, 11025, 22050 and 44100 sample rate\n");
         return -1;
     }