Tracktion bug? HostedAudioDeviceInterface::prepareToPlay

If the number of channels changes but the blocksize and samplerate do not then then buffers don’t get resized.

void HostedAudioDeviceInterface::prepareToPlay (double sampleRate, int blockSize)
{
    if (parameters.sampleRate != sampleRate || parameters.blockSize != blockSize)
    {
        parameters.sampleRate = sampleRate;
        parameters.blockSize  = blockSize;

        if (! parameters.fixedBlockSize)
        {
            int maxChannels = jmax (parameters.inputChannels, parameters.outputChannels);
            inputFifo.setSize (maxChannels, blockSize * 4);
            outputFifo.setSize (maxChannels, blockSize * 4);

            outputFifo.writeSilence (blockSize);
        }

        if (deviceType != nullptr)
            deviceType->settingsChanged();
    }
}

Thanks, I think I can fix that (although might be tomorrow). I think the fifo would also need resetting there.

Can I ask what scenario this happens in though? Do you support dynamic busses and this needs to respond to a bus layout change?

It crops up when you’re in a plugin wrapped in the JUCE standalone plugin wrapper. We have a work around - calling prepareToPlay twice with different values. So don’t rush on our account!