Cleanup
authorJean-Marc Valin <jean-marc.valin@octasic.com>
Tue, 8 Mar 2011 23:05:45 +0000 (18:05 -0500)
committerJean-Marc Valin <jean-marc.valin@octasic.com>
Tue, 8 Mar 2011 23:05:45 +0000 (18:05 -0500)
src/opus_encoder.c
src/test_opus.c

index 8008878..c002757 100644 (file)
@@ -589,6 +589,8 @@ void opus_encoder_ctl(OpusEncoder *st, int request, ...)
         case OPUS_SET_VOICE_RATIO_REQUEST:
         {
             int value = va_arg(ap, int);
         case OPUS_SET_VOICE_RATIO_REQUEST:
         {
             int value = va_arg(ap, int);
+            if (value>100 || value<0)
+                return OPUS_BAD_ARG;
             st->voice_ratio = value;
         }
         break;
             st->voice_ratio = value;
         }
         break;
index 57e610a..565f40d 100644 (file)
@@ -233,31 +233,6 @@ int main(int argc, char *argv[])
       return 1;
    }
 
       return 1;
    }
 
-   /*if (mode==MODE_SILK_ONLY)
-   {
-       if (bandwidth == BANDWIDTH_SUPERWIDEBAND || bandwidth == BANDWIDTH_FULLBAND)
-       {
-           fprintf (stderr, "Predictive mode only supports up to wideband\n");
-           return 1;
-       }
-   }
-   if (mode==MODE_HYBRID)
-   {
-       if (bandwidth != BANDWIDTH_SUPERWIDEBAND && bandwidth != BANDWIDTH_FULLBAND)
-       {
-           fprintf (stderr, "Hybrid mode only supports superwideband and fullband\n");
-           return 1;
-       }
-   }
-   if (mode==MODE_CELT_ONLY)
-   {
-       if (bandwidth == BANDWIDTH_MEDIUMBAND)
-       {
-           fprintf (stderr, "Transform mode does not support mediumband\n");
-           return 1;
-       }
-   }*/
-
    enc = opus_encoder_create(sampling_rate, channels);
    dec = opus_decoder_create(sampling_rate, channels);
 
    enc = opus_encoder_create(sampling_rate, channels);
    dec = opus_decoder_create(sampling_rate, channels);