Mercurial > hg > qm-vamp-plugins
diff plugins/BarBeatTrack.cpp @ 190:af6a5ba00a8f
Some fixes for MSVC
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 01 Feb 2018 16:36:55 +0000 |
parents | f96ea0e4b475 |
children |
line wrap: on
line diff
--- a/plugins/BarBeatTrack.cpp Tue Jan 30 20:24:17 2018 +0000 +++ b/plugins/BarBeatTrack.cpp Thu Feb 01 16:36:55 2018 +0000 @@ -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;