From cfb7a89f0e4c3f2401b8d32715d00eaaea4236f6 Mon Sep 17 00:00:00 2001 From: DomClark Date: Sun, 10 Sep 2017 08:06:38 +0100 Subject: [PATCH] Fix empty VST tracks creating noise in playback (#3798) --- plugins/vestige/vestige.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 650af5c52..0985f5e2e 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -32,6 +32,7 @@ #include #include +#include "BufferManager.h" #include "Engine.h" #include "gui_templates.h" #include "InstrumentPlayHandle.h" @@ -281,16 +282,19 @@ void vestigeInstrument::loadFile( const QString & _file ) void vestigeInstrument::play( sampleFrame * _buf ) { m_pluginMutex.lock(); + + const fpp_t frames = Engine::mixer()->framesPerPeriod(); + if( m_plugin == NULL ) { + BufferManager::clear( _buf, frames ); + m_pluginMutex.unlock(); return; } m_plugin->process( NULL, _buf ); - const fpp_t frames = Engine::mixer()->framesPerPeriod(); - instrumentTrack()->processAudioBuffer( _buf, frames, NULL ); m_pluginMutex.unlock();