Skip to content

Commit

Permalink
[SDL] iOS fix bug with audio interrupted by a phone call not restoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed May 14, 2019
1 parent 59da5b7 commit abcfe80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/audio/coreaudio/SDL_coreaudio.m
Expand Up @@ -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 {
Expand Down

0 comments on commit abcfe80

Please sign in to comment.