Gives an error when trying to create a stereo mode with DISABLE_STEREO defined.
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 21 Jun 2009 13:47:51 +0000 (09:47 -0400)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Sun, 21 Jun 2009 13:47:51 +0000 (09:47 -0400)
libcelt/modes.c

index c3c21e0..693780e 100644 (file)
@@ -418,6 +418,17 @@ CELTMode *celt_mode_create(celt_int32_t Fs, int channels, int frame_size, int *e
 #endif
    
 #endif /* !STATIC_MODES */
+
+#ifdef DISABLE_STEREO
+   if (channels > 1)
+   {
+      celt_warning("Stereo support was disable from this build");
+      if (error)
+         *error = CELT_BAD_ARG;
+      return NULL;
+   }
+#endif
+
    mdct_init(&mode->mdct, 2*mode->mdctSize);
    mode->fft = pitch_state_alloc(MAX_PERIOD);