[SDL] iOS fix bug with audio interrupted by a phone call not restoring.
authorSam Lantinga <slouken@libsdl.org>
Tue, 14 May 2019 14:20:54 -0700
changeset 12729a82d3c08d359
parent 12728 24cff6812c23
child 12730 792c26401463
[SDL] iOS fix bug with audio interrupted by a phone call not restoring.
src/audio/coreaudio/SDL_coreaudio.m
     1.1 --- a/src/audio/coreaudio/SDL_coreaudio.m	Tue May 14 07:55:42 2019 -0700
     1.2 +++ b/src/audio/coreaudio/SDL_coreaudio.m	Tue May 14 14:20:54 2019 -0700
     1.3 @@ -376,15 +376,16 @@
     1.4              /* An interruption end notification is not guaranteed to be sent if
     1.5               we were previously interrupted... resuming if needed when the app
     1.6               becomes active seems to be the way to go. */
     1.7 +			// Note: object: below needs to be nil, as otherwise it filters by the object, and session doesn't send foreground / active notifications.  johna
     1.8              [center addObserver:listener
     1.9                         selector:@selector(applicationBecameActive:)
    1.10                             name:UIApplicationDidBecomeActiveNotification
    1.11 -                         object:session];
    1.12 +                         object:nil];
    1.13  
    1.14              [center addObserver:listener
    1.15                         selector:@selector(applicationBecameActive:)
    1.16                             name:UIApplicationWillEnterForegroundNotification
    1.17 -                         object:session];
    1.18 +                         object:nil];
    1.19  
    1.20              this->hidden->interruption_listener = CFBridgingRetain(listener);
    1.21          } else {