diff plugins/BarBeatTrack.cpp @ 214:23b2a2f93c5a

Merge from branch MSVC
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 27 Apr 2018 15:48:50 +0100
parents af6a5ba00a8f
children
line wrap: on
line diff
--- a/plugins/BarBeatTrack.cpp	Fri Sep 30 19:04:06 2016 +0100
+++ b/plugins/BarBeatTrack.cpp	Fri Apr 27 15:48:50 2018 +0100
@@ -25,10 +25,6 @@
 using std::cerr;
 using std::endl;
 
-#ifndef __GNUC__
-#include <alloca.h>
-#endif
-
 float BarBeatTracker::m_stepSecs = 0.01161; // 512 samples at 44100
 
 class BarBeatTrackerData
@@ -341,15 +337,13 @@
     // We only support a single input channel
 
     const int fl = m_d->dfConfig.frameLength;
-#ifndef __GNUC__
-    double *dfinput = (double *)alloca(fl * sizeof(double));
-#else
-    double dfinput[fl];
-#endif
-    for (int i = 0; i < fl; ++i) dfinput[i] = inputBuffers[0][i];
+	double *dfinput = new double[fl];
 
+	for (int i = 0; i < fl; ++i) dfinput[i] = inputBuffers[0][i];
     double output = m_d->df->processTimeDomain(dfinput);
 
+	delete[] dfinput;
+
     if (m_d->dfOutput.empty()) m_d->origin = timestamp;
 
 //    std::cerr << "df[" << m_d->dfOutput.size() << "] is " << output << std::endl;