diff host/vamp-simple-host.cpp @ 453:22b29720da41 vampipe

Add test using new curve-fsr-mixed output from the Vamp Test Plugin, and make corresponding fix to timestamp logic
author Chris Cannam
date Wed, 14 Sep 2016 17:35:41 +0100
parents 4101e3f80aa0
children
line wrap: on
line diff
--- a/host/vamp-simple-host.cpp	Wed Sep 14 17:33:56 2016 +0100
+++ b/host/vamp-simple-host.cpp	Wed Sep 14 17:35:41 2016 +0100
@@ -508,7 +508,7 @@
               const Plugin::OutputDescriptor &output, int outputNo,
               const Plugin::FeatureSet &features, ofstream *out, bool useFrames)
 {
-    static int featureCount = 0;
+    static int featureCount = -1;
     
     if (features.find(outputNo) == features.end()) return;
     
@@ -523,12 +523,13 @@
             rt = f.timestamp;
             haveRt = true;
         } else if (output.sampleType == Plugin::OutputDescriptor::FixedSampleRate) {
-            int n = featureCount;
+            int n = featureCount + 1;
             if (f.hasTimestamp) {
                 n = int(round(toSeconds(f.timestamp) * output.sampleRate));
             }
             rt = RealTime::fromSeconds(double(n) / output.sampleRate);
             haveRt = true;
+            featureCount = n;
         }
         
         if (useFrames) {
@@ -570,8 +571,6 @@
         (out ? *out : cout) << " " << f.label;
 
         (out ? *out : cout) << endl;
-
-        ++featureCount;
     }
 }