Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[CA/AE] - make the devicelist change callback more robust - should fi…

…x crashes during shutdown on some system constellations (where removing the callback seems to also triggers the callback at the same time)
  • Loading branch information...
commit f6a002b0971138a785d03a934ad623b690a8becc 1 parent 5370a93
Memphiz Memphiz authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
12 xbmc/cores/AudioEngine/Engines/CoreAudio/CoreAudioAE.cpp
View
@@ -51,8 +51,11 @@ OSStatus deviceChangedCB( AudioObjectID inObjectID,
void* inClientData)
{
CCoreAudioAE *pEngine = (CCoreAudioAE *)inClientData;
- pEngine->AudioDevicesChanged();
- CLog::Log(LOGDEBUG, "CCoreAudioAE - audiodevicelist changed!");
+ if (pEngine->GetHAL())
+ {
+ pEngine->AudioDevicesChanged();
+ CLog::Log(LOGDEBUG, "CCoreAudioAE - audiodevicelist changed!");
+ }
return noErr;
}
@@ -102,8 +105,8 @@ CCoreAudioAE::CCoreAudioAE() :
CCoreAudioAE::~CCoreAudioAE()
{
- RegisterDeviceChangedCB(false, this);
Shutdown();
+ RegisterDeviceChangedCB(false, this);
}
void CCoreAudioAE::Shutdown()
@@ -138,6 +141,9 @@ void CCoreAudioAE::Shutdown()
void CCoreAudioAE::AudioDevicesChanged()
{
+ if (!m_Initialized)
+ return;
+
// give CA a bit time to realise that maybe the
// default device might have changed now - else
// OpenCoreAudio might open the old default device
Please sign in to comment.
Something went wrong with that request. Please try again.