CoreAudioOutput use timeout when waiting for render thread
On Snow Leopard (at least), changing the default audio device while audio is playing can cause CoreAudioOutput to freeze in audioThreadStop(). It seems that the OS stops calling renderCallback when the device changes, so audioThreadStop() waits forever. Change-Id: If7244cc50f12295ff91a979ef50e3bee1273affd Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
@@ -698,14 +698,14 @@ void CoreAudioOutput::audioThreadStop()
|
||||
{
|
||||
stopTimers();
|
||||
if (m_audioThreadState.testAndSetAcquire(Running, Stopped))
|
||||
m_threadFinished.wait(&m_mutex);
|
||||
m_threadFinished.wait(&m_mutex, 500);
|
||||
}
|
||||
|
||||
void CoreAudioOutput::audioThreadDrain()
|
||||
{
|
||||
stopTimers();
|
||||
if (m_audioThreadState.testAndSetAcquire(Running, Draining))
|
||||
m_threadFinished.wait(&m_mutex);
|
||||
m_threadFinished.wait(&m_mutex, 500);
|
||||
}
|
||||
|
||||
void CoreAudioOutput::audioDeviceStop()
|
||||
|
||||
Reference in New Issue
Block a user