Specify infinte timeout in tryLock on export

Ensures remote plugins always process sound on export.
Follow-up of 408b72c798.
This commit is contained in:
Hyunjin Song
2018-09-19 19:52:08 +09:00
parent dd7b0865fb
commit 9fe74c2730
3 changed files with 5 additions and 3 deletions

View File

@@ -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();

View File

@@ -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"
@@ -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();

View File

@@ -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"
@@ -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 );