changeset 68:47d6e670a810

* avoid warning about float-to-int conversion on frame2RealTime * define pi if it isn't already for some reason
author cannam
date Mon, 04 Jun 2007 13:31:04 +0000
parents 4017e21c12dd
children 3456fe86d385
files vamp-sdk/hostext/PluginInputDomainAdapter.cpp
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/vamp-sdk/hostext/PluginInputDomainAdapter.cpp	Mon Jun 04 10:55:46 2007 +0000
+++ b/vamp-sdk/hostext/PluginInputDomainAdapter.cpp	Mon Jun 04 13:31:04 2007 +0000
@@ -170,6 +170,11 @@
     return blockSize;
 }
 
+// for some visual studii apparently
+#ifndef M_PI
+#define M_PI 3.14159265358979232846
+#endif
+
 Plugin::FeatureSet
 PluginInputDomainAdapter::process(const float *const *inputBuffers, RealTime timestamp)
 {
@@ -221,8 +226,8 @@
 
 //    std::cerr << "PluginInputDomainAdapter: sampleRate " << m_inputSampleRate << ", blocksize " << m_blockSize << ", adjusting time from " << timestamp;
 
-    timestamp = timestamp + RealTime::frame2RealTime(m_blockSize/2,
-                                                     m_inputSampleRate);
+    timestamp = timestamp + RealTime::frame2RealTime
+        (m_blockSize/2, int(m_inputSampleRate + 0.5));
 
 //    std::cerr << " to " << timestamp << std::endl;