mirror of https://github.com/axmolengine/axmol.git
add error check for AVAudioSession setActive. (#19000)
This commit is contained in:
parent
6fb631e68e
commit
3c8c5139c1
|
@ -158,6 +158,11 @@ void AudioEngineInterruptionListenerCallback(void* user_data, UInt32 interruptio
|
|||
ALOGD("AVAudioSessionInterruptionTypeEnded, application == UIApplicationStateActive, alcMakeContextCurrent(s_ALContext)");
|
||||
NSError *error = nil;
|
||||
[[AVAudioSession sharedInstance] setActive:YES error:&error];
|
||||
if(error != nil){
|
||||
ALOGE("AVAudioSessionInterruptionTypeEnded, AVAudioSession setActive fail, %d",(int)error.code);
|
||||
return;
|
||||
}
|
||||
|
||||
alcMakeContextCurrent(s_ALContext);
|
||||
if (Director::getInstance()->isPaused())
|
||||
{
|
||||
|
@ -196,6 +201,10 @@ void AudioEngineInterruptionListenerCallback(void* user_data, UInt32 interruptio
|
|||
return;
|
||||
}
|
||||
[[AVAudioSession sharedInstance] setActive:YES error:&error];
|
||||
if(error != nil){
|
||||
ALOGE("UIApplicationDidBecomeActiveNotification, AVAudioSession setActive fail, %d",(int)error.code);
|
||||
return;
|
||||
}
|
||||
alcMakeContextCurrent(s_ALContext);
|
||||
}
|
||||
else if (isAudioSessionInterrupted)
|
||||
|
|
Loading…
Reference in New Issue