In the VST Wrapper ProcessReplacing metyhod there is the following code:
float* chan = tempChannels.getUnchecked(i);
if (chan == nullptr)
{
chan = outputs[i];
// if some output channels are disabled, some hosts supply the same buffer
// for multiple channels - this buggers up our method of copying the
// inputs over the outputs, so we need to create unique temp buffers in this case..
for (int j = i; --j >= 0;)
{
if (outputs[j] == chan)
{
chan = new float [blockSize * 2];
tempChannels.set (i, chan);
break;
}
}
}
I do not like the dynamic allocation in the audio thread, but this is not my biggest concern about this code.
I do not understand well the comment. Why directly copying the input into the output won't work even if some buffers given by the host are the same because of disabled channels.
In my case it seems to work well without these tempChannels but since I am not using the input and always memest the output to 0 before processing I do not see the problem.
Kevin
