Skip to content

Commit

Permalink
Specify infinte timeout in tryLock on export
Browse files Browse the repository at this point in the history
Ensures remote plugins always process sound on export.
Follow-up of 408b72c.
  • Loading branch information
PhysSong committed Sep 19, 2018
1 parent dd7b086 commit 9fe74c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/VstEffect/VstEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
sampleFrame * buf = new sampleFrame[_frames];
#endif
memcpy( buf, _buf, sizeof( sampleFrame ) * _frames );
if (m_pluginMutex.tryLock())
if (m_pluginMutex.tryLock(Engine::getSong()->isExporting() ? -1 : 0))
{
m_plugin->process( buf, buf );
m_pluginMutex.unlock();
Expand Down
3 changes: 2 additions & 1 deletion plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include "GuiApplication.h"
#include "PixmapButton.h"
#include "SampleBuffer.h"
#include "Song.h"
#include "StringPairDrag.h"
#include "TextFloat.h"
#include "ToolTip.h"
Expand Down Expand Up @@ -360,7 +361,7 @@ void vestigeInstrument::loadFile( const QString & _file )

void vestigeInstrument::play( sampleFrame * _buf )
{
if (!m_pluginMutex.tryLock()) {return;}
if (!m_pluginMutex.tryLock(Engine::getSong()->isExporting() ? -1 : 0)) {return;}

const fpp_t frames = Engine::mixer()->framesPerPeriod();

Expand Down
3 changes: 2 additions & 1 deletion plugins/zynaddsubfx/ZynAddSubFx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "InstrumentPlayHandle.h"
#include "InstrumentTrack.h"
#include "gui_templates.h"
#include "Song.h"
#include "StringPairDrag.h"
#include "RemoteZynAddSubFx.h"
#include "LocalZynAddSubFx.h"
Expand Down Expand Up @@ -325,7 +326,7 @@ QString ZynAddSubFxInstrument::nodeName() const

void ZynAddSubFxInstrument::play( sampleFrame * _buf )
{
if (!m_pluginMutex.tryLock()) {return;}
if (!m_pluginMutex.tryLock(Engine::getSong()->isExporting() ? -1 : 0)) {return;}
if( m_remotePlugin )
{
m_remotePlugin->process( NULL, _buf );
Expand Down

0 comments on commit 9fe74c2

Please sign in to comment.