Mercurial > hg > vamp-plugin-sdk
diff src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 419:55de53d7c777
Merge
author | Chris Cannam |
---|---|
date | Tue, 01 Mar 2016 12:21:23 +0000 |
parents | e0697515163f |
children | 35fa4733bc5d |
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginInputDomainAdapter.cpp Tue Mar 01 12:10:29 2016 +0000 +++ b/src/vamp-hostsdk/PluginInputDomainAdapter.cpp Tue Mar 01 12:21:23 2016 +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) {