changeset 91:200a663bace1

* more fine tuning of handling of block and step sizes
author cannam
date Thu, 01 Nov 2007 10:25:35 +0000
parents 036db77506f7
children c94c066a4897
files host/vamp-simple-host.cpp
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/host/vamp-simple-host.cpp	Fri Oct 19 12:49:56 2007 +0000
+++ b/host/vamp-simple-host.cpp	Thu Nov 01 10:25:35 2007 +0000
@@ -245,13 +245,23 @@
     int blockSize = plugin->getPreferredBlockSize();
     int stepSize = plugin->getPreferredStepSize();
 
-    if (blockSize == 0) blockSize = 1024;
+    if (blockSize == 0) {
+        blockSize = 1024;
+    }
     if (stepSize == 0) {
         if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
             stepSize = blockSize/2;
         } else {
             stepSize = blockSize;
         }
+    } else if (stepSize > blockSize) {
+        cerr << "WARNING: stepSize " << stepSize << " > blockSize " << blockSize << ", resetting blockSize to ";
+        if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
+            blockSize = stepSize * 2;
+        } else {
+            blockSize = stepSize;
+        }
+        cerr << blockSize << endl;
     }
 
     int channels = sfinfo.channels;