clear up some stupid thinking in Amp regarding the way the underlying AutomationContr...
[ardour.git] / libs / ardour / vst_plugin.cc
index 729ee5c129484f344a5c8ce4f23657f9fc1729f3..5c9c94bdac9a5d303570bc81729125201bf1f10f 100644 (file)
@@ -535,8 +535,17 @@ VSTPlugin::connect_and_run (BufferSet& bufs,
        BufferSet& silent_bufs  = _session.get_silent_buffers(bufs_count);
        BufferSet& scratch_bufs = _session.get_scratch_buffers(bufs_count);
 
-       float *ins[_plugin->numInputs];
-       float *outs[_plugin->numOutputs];
+       /* VC++ doesn't support the C99 extension that allows 
+
+          typeName foo[variableDefiningSize];
+          
+          Use alloca instead of dynamic array (rather than std::vector which
+          allocs on the heap) because this is realtime code.
+       */
+          
+       float** ins = (float**)alloca(_plugin->numInputs*sizeof(float*));
+       float** outs = (float**)alloca(_plugin->numInputs*sizeof(float*));
+
        int32_t i;
 
        uint32_t in_index = 0;
@@ -565,7 +574,7 @@ VSTPlugin::connect_and_run (BufferSet& bufs,
        }
 
        /* we already know it can support processReplacing */
-       _plugin->processReplacing (_plugin, ins, outs, nframes);
+       _plugin->processReplacing (_plugin, &ins[0], &outs[0], nframes);
 
        return 0;
 }