src/spectral, src/onset, src/tempo: make sure win_size > 1
authorPaul Brossier <piem@piem.org>
Tue, 16 Feb 2016 14:43:14 +0000 (15:43 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 16 Feb 2016 14:43:14 +0000 (15:43 +0100)
src/onset/onset.c
src/spectral/fft.c
src/spectral/phasevoc.c
src/tempo/tempo.c

index d8f10d6..ae30047 100644 (file)
@@ -186,8 +186,8 @@ aubio_onset_t * new_aubio_onset (char_t * onset_mode,
   if ((sint_t)hop_size < 1) {
     AUBIO_ERR("onset: got hop_size %d, but can not be < 1\n", hop_size);
     goto beach;
-  } else if ((sint_t)buf_size < 1) {
-    AUBIO_ERR("onset: got buffer_size %d, but can not be < 1\n", buf_size);
+  } else if ((sint_t)buf_size < 2) {
+    AUBIO_ERR("onset: got buffer_size %d, but can not be < 2\n", buf_size);
     goto beach;
   } else if (buf_size < hop_size) {
     AUBIO_ERR("onset: hop size (%d) is larger than win size (%d)\n", buf_size, hop_size);
index 8841ca2..2545f0f 100644 (file)
@@ -143,8 +143,8 @@ struct _aubio_fft_t {
 
 aubio_fft_t * new_aubio_fft (uint_t winsize) {
   aubio_fft_t * s = AUBIO_NEW(aubio_fft_t);
-  if ((sint_t)winsize < 1) {
-    AUBIO_ERR("fft: got winsize %d, but can not be < 1\n", winsize);
+  if ((sint_t)winsize < 2) {
+    AUBIO_ERR("fft: got winsize %d, but can not be < 2\n", winsize);
     goto beach;
   }
 #ifdef HAVE_FFTW3
index 1b55e77..4fdbd78 100644 (file)
@@ -79,8 +79,8 @@ aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s) {
   if ((sint_t)hop_s < 1) {
     AUBIO_ERR("pvoc: got hop_size %d, but can not be < 1\n", hop_s);
     goto beach;
-  } else if ((sint_t)win_s < 1) {
-    AUBIO_ERR("pvoc: got buffer_size %d, but can not be < 1\n", win_s);
+  } else if ((sint_t)win_s < 2) {
+    AUBIO_ERR("pvoc: got buffer_size %d, but can not be < 2\n", win_s);
     goto beach;
   } else if (win_s < hop_s) {
     AUBIO_ERR("pvoc: hop size (%d) is larger than win size (%d)\n", win_s, hop_s);
index ee25be7..be6efa3 100644 (file)
@@ -173,8 +173,8 @@ aubio_tempo_t * new_aubio_tempo (char_t * tempo_mode,
   if ((sint_t)hop_size < 1) {
     AUBIO_ERR("tempo: got hop size %d, but can not be < 1\n", hop_size);
     goto beach;
-  } else if ((sint_t)buf_size < 1) {
-    AUBIO_ERR("tempo: got window size %d, but can not be < 1\n", buf_size);
+  } else if ((sint_t)buf_size < 2) {
+    AUBIO_ERR("tempo: got window size %d, but can not be < 2\n", buf_size);
     goto beach;
   } else if (buf_size < hop_size) {
     AUBIO_ERR("tempo: hop size (%d) is larger than window size (%d)\n", buf_size, hop_size);