diff src/Silvet.cpp @ 313:fa2ffbb786df

Don't rely on column count to determine whether we've set the start time or not -- it could theoretically be 0 even after some input has appeared
author Chris Cannam
date Tue, 28 Apr 2015 11:09:31 +0100
parents 796d403dc83b
children f98ba4f47e49
line wrap: on
line diff
--- a/src/Silvet.cpp	Tue Apr 28 10:02:36 2015 +0100
+++ b/src/Silvet.cpp	Tue Apr 28 11:09:31 2015 +0100
@@ -51,7 +51,8 @@
     m_hqMode(true),
     m_fineTuning(false),
     m_instrument(0),
-    m_colsPerSec(50)
+    m_colsPerSec(50),
+    m_haveStartTime(false)
 {
 }
 
@@ -465,13 +466,15 @@
     m_columnCount = 0;
     m_resampledCount = 0;
     m_startTime = RealTime::zeroTime;
+    m_haveStartTime = false;
 }
 
 Silvet::FeatureSet
 Silvet::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
 {
-    if (m_columnCount == 0) {
+    if (!m_haveStartTime) {
         m_startTime = timestamp;
+        m_haveStartTime = true;
     }
 
     vector<float> flattened(m_blockSize);