# HG changeset patch # User Chris Cannam # Date 1421254733 0 # Node ID e0697515163f85c8edf039c5de71b4c2968ffc07 # Parent 632d90c185ecc8655f7a85ba58dc568351449dfd Fine adjustment to timestamp to avoid rounding error diff -r 632d90c185ec -r e0697515163f src/vamp-hostsdk/PluginInputDomainAdapter.cpp --- a/src/vamp-hostsdk/PluginInputDomainAdapter.cpp Thu Oct 16 10:50:20 2014 +0100 +++ b/src/vamp-hostsdk/PluginInputDomainAdapter.cpp Wed Jan 14 16:58:53 2015 +0000 @@ -508,7 +508,14 @@ RealTime timestamp) { if (m_method == ShiftTimestamp) { + // we may need to add one nsec if timestamp + + // getTimestampAdjustment() rounds down timestamp = timestamp + getTimestampAdjustment(); + RealTime nsec(0, 1); + if (RealTime::realTime2Frame(timestamp, m_inputSampleRate) < + RealTime::realTime2Frame(timestamp + nsec, m_inputSampleRate)) { + timestamp = timestamp + nsec; + } } for (int c = 0; c < m_channels; ++c) {