From f08fb046ceee8f69dd3fc9964a942509fe651bec Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 22 Dec 2010 10:51:34 +0000 Subject: Audio: * Improve Jack Transport responsiveness. * Added minor error checking to OpenAL. --- intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'intern/audaspace/OpenAL') diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index a87a4ad5eef..5df7ec4fb0c 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -128,13 +128,15 @@ void AUD_OpenALDevice::updateStreams() ALint info; AUD_DeviceSpecs specs = m_specs; + ALCenum cerr; while(1) { lock(); alcSuspendContext(m_context); - + cerr = alcGetError(m_device); + if(cerr == ALC_NO_ERROR) { // for all sounds for(AUD_HandleIterator it = m_playingSounds->begin(); it != m_playingSounds->end(); it++) @@ -253,12 +255,12 @@ void AUD_OpenALDevice::updateStreams() alSourcePlay(sound->source); } } - } - alcProcessContext(m_context); + alcProcessContext(m_context); + } // stop thread - if(m_playingSounds->empty()) + if(m_playingSounds->empty() || (cerr != ALC_NO_ERROR)) { unlock(); m_playing = false; -- cgit v1.2.3