From dbc404cca12e611e44fae08e054d3a399c75c6cf Mon Sep 17 00:00:00 2001 From: Vesa Date: Sun, 7 Dec 2014 22:29:23 +0200 Subject: [PATCH] Fix FX mixer race condition --- src/core/FxMixer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index b1494e00d..7169a25ee 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -104,7 +104,6 @@ void FxChannel::incrementDeps() { m_queued = true; MixerWorkerThread::addJob( this ); - m_dependenciesMet = 0; } } @@ -174,7 +173,7 @@ void FxChannel::doProcessing() // only start fxchain when we have input... m_fxChain.startRunning(); } - + m_stillRunning = m_fxChain.processAudioBuffer( m_buffer, fpp, m_hasInput ); m_peakLeft = qMax( m_peakLeft, Engine::mixer()->peakValueLeft( m_buffer, fpp ) * v ); @@ -184,8 +183,8 @@ void FxChannel::doProcessing() { m_peakLeft = m_peakRight = 0.0f; } - - // increment dependency counter of all receivers + + // increment dependency counter of all receivers processed(); } @@ -430,7 +429,7 @@ FxRoute * FxMixer::createRoute( FxChannel * from, FxChannel * to, float amount ) // add us to fxmixer's list Engine::fxMixer()->m_fxRoutes.append( route ); m_sendsMutex.unlock(); - + return route; } @@ -613,6 +612,7 @@ void FxMixer::masterMix( sampleFrame * _buf ) m_fxChannels[i]->m_queued = false; // also reset hasInput m_fxChannels[i]->m_hasInput = false; + m_fxChannels[i]->m_dependenciesMet = 0; } } @@ -688,7 +688,7 @@ void FxMixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" ); } } -} +} // make sure we have at least num channels void FxMixer::allocateChannelsTo(int num)