diff src/Silvet.cpp @ 356:7dcff010d9cd

Some tidying, switch to libc++
author Chris Cannam
date Mon, 07 Sep 2015 14:45:19 +0100
parents a3fc6e1f2d4e
children 0af00da90a40
line wrap: on
line diff
--- a/src/Silvet.cpp	Mon Sep 07 12:01:19 2015 +0100
+++ b/src/Silvet.cpp	Mon Sep 07 14:45:19 2015 +0100
@@ -24,17 +24,21 @@
 #include "LiveInstruments.h"
 
 #include <vector>
-#include <future>
 
 #include <cstdio>
 
+#if (defined(MAX_EM_THREADS) && (MAX_EM_THREADS > 1))
+#include <future>
+using std::future;
+using std::async;
+#endif
+
 using std::vector;
 using std::cout;
 using std::cerr;
 using std::endl;
 using std::pair;
-using std::future;
-using std::async;
+
 using Vamp::RealTime;
 
 static int processingSampleRate = 44100;
@@ -727,7 +731,11 @@
         localBestShifts = vector<vector<int> >(width);
     }
 
-    int emThreadCount = MAX_EM_THREADS;
+    int emThreadCount = 1;
+
+#if (defined(MAX_EM_THREADS) && (MAX_EM_THREADS > 1))
+    emThreadCount = MAX_EM_THREADS;
+
     if (emThreadCount > int(std::thread::hardware_concurrency())) {
         emThreadCount = std::thread::hardware_concurrency();
     }
@@ -736,7 +744,6 @@
         emThreadCount = 1;
     }
 
-#if (defined(MAX_EM_THREADS) && (MAX_EM_THREADS > 1))
     if (emThreadCount > 1) {
         for (int i = 0; i < width; ) {
             typedef future<pair<vector<double>, vector<int>>> EMFuture;