Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[AE/CA] - hold the enginelock when diddleing with the hal during garb…

…agecollect and reuse the resume() function instead of duplicating code
  • Loading branch information...
commit 70caaf7b71b353397bc314d83b6d4d5833bdacc4 1 parent fdb60ac
@Memphiz Memphiz authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
View
5 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
@@ -650,6 +650,7 @@ void CCoreAudioAE::GarbageCollect()
{
if (m_isSuspended)
{
+ CSingleLock engineLock(m_engineLock);
CLog::Log(LOGDEBUG, "CCoreAudioAE::GarbageCollect - Acquire CA HAL.");
Start();
m_isSuspended = false;
@@ -660,8 +661,7 @@ void CCoreAudioAE::GarbageCollect()
unsigned int curSystemClock = XbmcThreads::SystemClockMillis();
if (!m_isSuspended && m_softSuspend && curSystemClock > m_softSuspendTimer)
{
- Stop();
- m_isSuspended = true;
+ Suspend();// locks m_engineLock internally
CLog::Log(LOGDEBUG, "CCoreAudioAE::GarbageCollect - Release CA HAL.");
}
}
@@ -692,6 +692,7 @@ void CCoreAudioAE::Stop()
bool CCoreAudioAE::Suspend()
{
+ CSingleLock engineLock(m_engineLock);
CLog::Log(LOGDEBUG, "CCoreAudioAE::Suspend - Suspending AE processing");
m_isSuspended = true;
// stop all gui sounds
Please sign in to comment.
Something went wrong with that request. Please try again.