Adjust rate when forceMode is set (--force-nb, --force-wb)
authorjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 16 Aug 2002 06:23:20 +0000 (06:23 +0000)
committerjmvalin <jmvalin@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Fri, 16 Aug 2002 06:23:20 +0000 (06:23 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@3829 0101bb08-14d6-0310-b084-bc0e0c8e3800

src/speexdec.c

index d650e32..bddb43f 100644 (file)
@@ -175,7 +175,12 @@ static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, in
    speex_decoder_ctl(st, SPEEX_SET_ENH, &enh_enabled);
    speex_decoder_ctl(st, SPEEX_GET_FRAME_SIZE, frame_size);
    
+   /* FIXME: need to adjust in case the forceMode option is set */
    *rate = header->rate;
+   if (header->mode==1 && forceMode==0)
+      *rate/=2;
+   if (header->mode==0 && forceMode==1)
+      *rate*=2;
    *nframes = header->frames_per_packet;
    
    fprintf (stderr, "Decoding %d Hz audio using %s mode",