changeset 83:94a42248ec33

* don't allow block/step sizes to be undefined
author cannam
date Mon, 24 Sep 2007 14:44:48 +0000
parents c8b48bc6db3d
children af0d86b8b692
files host/vamp-simple-host.cpp
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/host/vamp-simple-host.cpp	Wed Sep 19 14:04:12 2007 +0000
+++ b/host/vamp-simple-host.cpp	Mon Sep 24 14:44:48 2007 +0000
@@ -198,6 +198,15 @@
     int blockSize = plugin->getPreferredBlockSize();
     int stepSize = plugin->getPreferredStepSize();
 
+    if (blockSize == 0) blockSize = 1024;
+    if (stepSize == 0) {
+        if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
+            stepSize = blockSize/2;
+        } else {
+            stepSize = blockSize;
+        }
+    }
+
     int channels = sfinfo.channels;
 
     float *filebuf = new float[blockSize * channels];