diff --git a/framework/vst/internal/vstaudioclient.cpp b/framework/vst/internal/vstaudioclient.cpp index be82b789e0..567b594e69 100644 --- a/framework/vst/internal/vstaudioclient.cpp +++ b/framework/vst/internal/vstaudioclient.cpp @@ -436,11 +436,13 @@ void VstAudioClient::updateProcessSetup() setup.sampleRate = m_outputSpec.sampleRate; if (processor->setupProcessing(setup) != Steinberg::kResultOk) { + m_isProcessingSetUp = false; return; } setUpProcessData(); flushBuffers(); + m_isProcessingSetUp = true; ensureActivity(); } @@ -551,6 +553,13 @@ void VstAudioClient::ensureActivity() return; } + //! NOTE: The plugin may finish loading after the track has already been + //! switched on (e.g. right before an export). Activating it before + //! setupProcessing() would let process() run without output buffers + if (!m_isProcessingSetUp) { + return; + } + IAudioProcessorPtr processor = pluginProcessor(); if (!processor) { return; diff --git a/framework/vst/internal/vstaudioclient.h b/framework/vst/internal/vstaudioclient.h index 2c2672ca2a..9251c6d8b9 100644 --- a/framework/vst/internal/vstaudioclient.h +++ b/framework/vst/internal/vstaudioclient.h @@ -99,6 +99,7 @@ class VstAudioClient bool m_needUnprepareProcessData = false; bool m_needUpdateState = false; + bool m_isProcessingSetUp = false; PluginType m_type = PluginType::Undefined; audio::OutputSpec m_outputSpec;