changeset 353:bd9a63d35e71

Use double arithmetic for rate calculations
author Chris Cannam
date Thu, 28 Mar 2013 13:40:38 +0000
parents 60ede78a20db
children e85513153c71
files src/vamp-hostsdk/PluginBufferingAdapter.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/vamp-hostsdk/PluginBufferingAdapter.cpp	Thu Mar 28 09:41:47 2013 +0000
+++ b/src/vamp-hostsdk/PluginBufferingAdapter.cpp	Thu Mar 28 13:40:38 2013 +0000
@@ -617,11 +617,11 @@
         double secs = feature.timestamp.sec;
         secs += feature.timestamp.nsec / 1e9;
         m_fixedRateFeatureNos[outputNo] =
-            int(secs * m_outputs[outputNo].sampleRate + 0.5);
+            int(secs * double(m_outputs[outputNo].sampleRate) + 0.5);
     }
 
     feature.timestamp = RealTime::fromSeconds
-        (m_fixedRateFeatureNos[outputNo] / m_outputs[outputNo].sampleRate);
+        (m_fixedRateFeatureNos[outputNo] / double(m_outputs[outputNo].sampleRate));
 
     feature.hasTimestamp = true;