From: Paul Brossier Date: Tue, 16 Feb 2016 14:43:14 +0000 (+0100) Subject: src/spectral, src/onset, src/tempo: make sure win_size > 1 X-Git-Tag: 0.4.4~300^2~341 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=d897aaed4775b429eeb8f608313a904fd54a97be;p=aubio.git src/spectral, src/onset, src/tempo: make sure win_size > 1 --- diff --git a/src/onset/onset.c b/src/onset/onset.c index d8f10d67..ae300471 100644 --- a/src/onset/onset.c +++ b/src/onset/onset.c @@ -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); diff --git a/src/spectral/fft.c b/src/spectral/fft.c index 8841ca2b..2545f0f0 100644 --- a/src/spectral/fft.c +++ b/src/spectral/fft.c @@ -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 diff --git a/src/spectral/phasevoc.c b/src/spectral/phasevoc.c index 1b55e774..4fdbd789 100644 --- a/src/spectral/phasevoc.c +++ b/src/spectral/phasevoc.c @@ -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); diff --git a/src/tempo/tempo.c b/src/tempo/tempo.c index ee25be79..be6efa30 100644 --- a/src/tempo/tempo.c +++ b/src/tempo/tempo.c @@ -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);