Fix empty VST tracks creating noise in playback (#3798)

This commit is contained in:
DomClark
2017-09-10 08:06:38 +01:00
committed by Oskar Wallgren
parent 7429cb8155
commit cfb7a89f0e

View File

@@ -32,6 +32,7 @@
#include <QMenu>
#include <QDomElement>
#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();