summaryrefslogtreecommitdiff
path: root/libs/panners/vbap
diff options
context:
space:
mode:
authorJohn Emmas <johne53@tiscali.co.uk>2013-09-03 14:46:01 +0100
committerJohn Emmas <johne53@tiscali.co.uk>2013-09-03 14:46:01 +0100
commit86a39108140a60fda2dffd9d4b378f915c3a47ab (patch)
tree40574f68a35a67527966e69c8db8515bae161ae4 /libs/panners/vbap
parenta431e73ccda3953fc290dbacecd4b2e8ef181676 (diff)
'libs/panners' - Use 'alloca()' for a stack based array whose size is unknown (required to be buildable with MSVC)
Diffstat (limited to 'libs/panners/vbap')
-rw-r--r--libs/panners/vbap/vbap.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/panners/vbap/vbap.cc b/libs/panners/vbap/vbap.cc
index f5cbca79e0..f1da6a5829 100644
--- a/libs/panners/vbap/vbap.cc
+++ b/libs/panners/vbap/vbap.cc
@@ -25,6 +25,8 @@
#include <iostream>
#include <string>
+#include <malloc.h>
+
#include "pbd/cartesian.h"
#include "pbd/compose.h"
@@ -290,7 +292,7 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
assert (sz == obufs.count().n_audio());
- int8_t outputs[sz]; // on the stack, no malloc
+ int8_t *outputs = (int8_t*)alloca(sz); // on the stack, no malloc
/* set initial state of each output "record"
*/
@@ -319,10 +321,10 @@ VBAPanner::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gain_co
/* at this point, we can test a speaker's status:
- (outputs[o] & 1) <= in use before
- (outputs[o] & 2) <= in use this time
- (outputs[o] & 3) == 3 <= in use both times
- outputs[o] == 0 <= not in use either time
+ (*outputs[o] & 1) <= in use before
+ (*outputs[o] & 2) <= in use this time
+ (*outputs[o] & 3) == 3 <= in use both times
+ *outputs[o] == 0 <= not in use either time
*/