# HG changeset patch # User cannam # Date 1252596094 0 # Node ID f3b1ba71a3055dc51b19a11cb19326f23b773e32 # Parent 91574fc544db78ad3f03635c61e45b39d14f03a4 * When calculating timestamps in order to write them into features that previously lacked them, from a buffering adapter, we need to take into account any timestamp adjustment used by other wrappers that are being wrapped by this one (i.e. input domain adapter) diff -r 91574fc544db -r f3b1ba71a305 src/vamp-hostsdk/PluginBufferingAdapter.cpp --- a/src/vamp-hostsdk/PluginBufferingAdapter.cpp Thu Sep 10 13:24:26 2009 +0000 +++ b/src/vamp-hostsdk/PluginBufferingAdapter.cpp Thu Sep 10 15:21:34 2009 +0000 @@ -39,6 +39,7 @@ #include #include +#include using std::vector; using std::map; @@ -652,6 +653,14 @@ FeatureSet featureSet = m_plugin->process(m_buffers, timestamp); + PluginWrapper *wrapper = dynamic_cast(m_plugin); + RealTime adjustment; + if (wrapper) { + PluginInputDomainAdapter *ida = + wrapper->getWrapper(); + if (ida) adjustment = ida->getTimestampAdjustment(); + } + for (FeatureSet::iterator iter = featureSet.begin(); iter != featureSet.end(); ++iter) { @@ -667,14 +676,14 @@ case OutputDescriptor::OneSamplePerStep: // use our internal timestamp, always - featureList[i].timestamp = timestamp; + featureList[i].timestamp = timestamp + adjustment; featureList[i].hasTimestamp = true; break; case OutputDescriptor::FixedSampleRate: // use our internal timestamp if feature lacks one if (!featureList[i].hasTimestamp) { - featureList[i].timestamp = timestamp; + featureList[i].timestamp = timestamp + adjustment; featureList[i].hasTimestamp = true; } break;