ref: d897aaed4775b429eeb8f608313a904fd54a97be
parent: d7f3c88f5d81c20f1b7ca1d71a3f90c8dc1c91e9
author: Paul Brossier <piem@piem.org>
date: Tue Feb 16 10:43:14 EST 2016
src/spectral, src/onset, src/tempo: make sure win_size > 1
--- a/src/onset/onset.c
+++ b/src/onset/onset.c
@@ -186,8 +186,8 @@
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);
--- a/src/spectral/fft.c
+++ b/src/spectral/fft.c
@@ -143,8 +143,8 @@
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
--- a/src/spectral/phasevoc.c
+++ b/src/spectral/phasevoc.c
@@ -79,8 +79,8 @@
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);
--- a/src/tempo/tempo.c
+++ b/src/tempo/tempo.c
@@ -173,8 +173,8 @@
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);