changeset 222:bd084c486076

Fix incorrect time alignment of tonal-change plugin outputs. This bug was introduced in December 2008, so we are squashing it just before its tenth birthday.
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 05 Nov 2018 15:31:19 +0000
parents 9de7d3bcf7e3
children b574a0a1dfca
files plugins/TonalChangeDetect.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/TonalChangeDetect.cpp	Tue May 15 15:43:15 2018 +0100
+++ b/plugins/TonalChangeDetect.cpp	Mon Nov 05 15:31:19 2018 +0000
@@ -104,7 +104,7 @@
 
 int TonalChangeDetect::getPluginVersion() const
 {
-    return 2;
+    return 3;
 }
 
 std::string TonalChangeDetect::getCopyright() const
@@ -314,6 +314,7 @@
 
 TonalChangeDetect::FeatureSet
 TonalChangeDetect::process(const float *const *inputBuffers,
+
                            Vamp::RealTime timestamp)
 {
     if (!m_chromagram) {
@@ -323,7 +324,10 @@
 	return FeatureSet();
     }
 
-    if (!m_haveOrigin) m_origin = timestamp;
+    if (!m_haveOrigin) {
+        m_origin = timestamp;
+        m_haveOrigin = true;
+    }
 
     // convert float* to double*
     double *tempBuffer = new double[m_block];