# HG changeset patch # User cannam # Date 1193912735 0 # Node ID 200a663bace1aa2d214421b9cd5a344433db0127 # Parent 036db77506f732caf1d058b5f61f89cb7c69b177 * more fine tuning of handling of block and step sizes diff -r 036db77506f7 -r 200a663bace1 host/vamp-simple-host.cpp --- 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;