From abcfe804804f7f9ee11f51a211c6e7d1d5039651 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 14 May 2019 14:20:54 -0700 Subject: [PATCH] [SDL] iOS fix bug with audio interrupted by a phone call not restoring. --- src/audio/coreaudio/SDL_coreaudio.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/audio/coreaudio/SDL_coreaudio.m b/src/audio/coreaudio/SDL_coreaudio.m index 96d2ca046f72f..e1f56ae937edd 100644 --- a/src/audio/coreaudio/SDL_coreaudio.m +++ b/src/audio/coreaudio/SDL_coreaudio.m @@ -376,15 +376,16 @@ static BOOL update_audio_session(_THIS, SDL_bool open) /* An interruption end notification is not guaranteed to be sent if we were previously interrupted... resuming if needed when the app becomes active seems to be the way to go. */ + // Note: object: below needs to be nil, as otherwise it filters by the object, and session doesn't send foreground / active notifications. johna [center addObserver:listener selector:@selector(applicationBecameActive:) name:UIApplicationDidBecomeActiveNotification - object:session]; + object:nil]; [center addObserver:listener selector:@selector(applicationBecameActive:) name:UIApplicationWillEnterForegroundNotification - object:session]; + object:nil]; this->hidden->interruption_listener = CFBridgingRetain(listener); } else {