Skip to content

Commit

Permalink
Fix empty VST tracks creating noise in playback (#3798)
Browse files Browse the repository at this point in the history
  • Loading branch information
DomClark authored and zonkmachine committed Sep 10, 2017
1 parent 7429cb8 commit cfb7a89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <QMenu>
#include <QDomElement>

#include "BufferManager.h"
#include "Engine.h"
#include "gui_templates.h"
#include "InstrumentPlayHandle.h"
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit cfb7a89

Please sign in to comment.