Skip to content
This repository
Browse code

[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 authored January 20, 2013
5  xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
@@ -650,6 +650,7 @@ void CCoreAudioAE::GarbageCollect()
650 650
   {
651 651
     if (m_isSuspended)
652 652
     {
  653
+      CSingleLock engineLock(m_engineLock);
653 654
       CLog::Log(LOGDEBUG, "CCoreAudioAE::GarbageCollect - Acquire CA HAL.");
654 655
       Start();
655 656
       m_isSuspended = false;
@@ -660,8 +661,7 @@ void CCoreAudioAE::GarbageCollect()
660 661
   unsigned int curSystemClock = XbmcThreads::SystemClockMillis();
661 662
   if (!m_isSuspended && m_softSuspend && curSystemClock > m_softSuspendTimer)
662 663
   {
663  
-    Stop();
664  
-    m_isSuspended = true;
  664
+    Suspend();// locks m_engineLock internally
665 665
     CLog::Log(LOGDEBUG, "CCoreAudioAE::GarbageCollect - Release CA HAL.");
666 666
   }
667 667
 }
@@ -692,6 +692,7 @@ void CCoreAudioAE::Stop()
692 692
 
693 693
 bool CCoreAudioAE::Suspend()
694 694
 {
  695
+  CSingleLock engineLock(m_engineLock);
695 696
   CLog::Log(LOGDEBUG, "CCoreAudioAE::Suspend - Suspending AE processing");
696 697
   m_isSuspended = true;
697 698
   // stop all gui sounds

0 notes on commit 70caaf7

Please sign in to comment.
Something went wrong with that request. Please try again.