Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/framework/vst/internal/vstaudioclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,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();
}
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/framework/vst/internal/vstaudioclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class VstAudioClient : public muse::Contextable

bool m_needUnprepareProcessData = false;
bool m_needUpdateState = false;
bool m_isProcessingSetUp = false;

audioplugins::AudioPluginType m_type = audioplugins::AudioPluginType::Undefined;
audio::OutputSpec m_outputSpec;
Expand Down
Loading