Move playhandle-adding to the correct spot so playhandles won't get delayed
This commit is contained in:
@@ -337,15 +337,9 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
m_inputBufferFrames[ m_inputBufferWrite ] = 0;
|
||||
unlockInputFrames();
|
||||
|
||||
|
||||
// now we have to make sure no other thread does anything bad
|
||||
// while we're acting...
|
||||
lock();
|
||||
// add all play-handles that have to be added
|
||||
m_playHandleMutex.lock();
|
||||
m_playHandles += m_newPlayHandles;
|
||||
m_newPlayHandles.clear();
|
||||
m_playHandleMutex.unlock();
|
||||
|
||||
// remove all play-handles that have to be deleted and delete
|
||||
// them if they still exist...
|
||||
@@ -380,6 +374,11 @@ const surroundSampleFrame * Mixer::renderNextBuffer()
|
||||
// create play-handles for new notes, samples etc.
|
||||
engine::getSong()->processNextBuffer();
|
||||
|
||||
// add all play-handles that have to be added
|
||||
m_playHandleMutex.lock();
|
||||
m_playHandles += m_newPlayHandles;
|
||||
m_newPlayHandles.clear();
|
||||
m_playHandleMutex.unlock();
|
||||
|
||||
// STAGE 1: run and render all play handles
|
||||
MixerWorkerThread::fillJobQueue<PlayHandleList>( m_playHandles );
|
||||
|
||||
Reference in New Issue
Block a user