# HG changeset patch # User Chris Cannam # Date 1229092182 0 # Node ID f98b58fb294f1f96ef999c554f3924b3cca47f11 # Parent 3bd7b07c08915a63c4047d36f78e0bb9e2b3a0c1 * Set block & step sizes if not properly specified diff -r 3bd7b07c0891 -r f98b58fb294f runner/FeatureExtractionManager.cpp --- a/runner/FeatureExtractionManager.cpp Thu Dec 11 15:19:07 2008 +0000 +++ b/runner/FeatureExtractionManager.cpp Fri Dec 12 14:29:42 2008 +0000 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -32,6 +33,7 @@ using Vamp::HostExt::PluginBufferingAdapter; using Vamp::HostExt::PluginInputDomainAdapter; using Vamp::HostExt::PluginSummarisingAdapter; +using Vamp::HostExt::PluginWrapper; #include "data/fileio/FileSource.h" #include "data/fileio/AudioFileReader.h" @@ -255,6 +257,29 @@ cerr << "NOTE: Loaded and initialised plugin " << plugin << " for transform \"" << transform.getIdentifier().toStdString() << "\"" << endl; + + } else { + + if (transform.getStepSize() == 0 || transform.getBlockSize() == 0) { + + PluginWrapper *pw = dynamic_cast(plugin); + if (pw) { + PluginBufferingAdapter *pba = + pw->getWrapper(); + if (pba) { + size_t actualStepSize = 0; + size_t actualBlockSize = 0; + pba->getActualStepAndBlockSizes(actualStepSize, + actualBlockSize); + if (transform.getStepSize() == 0) { + transform.setStepSize(actualStepSize); + } + if (transform.getBlockSize() == 0) { + transform.setBlockSize(actualBlockSize); + } + } + } + } } if (transform.getOutput() == "") {