src/audio/coreaudio/SDL_coreaudio.m
changeset 12001 84c2582329b0
parent 11945 ffd52bb02bcc
child 12503 806492103856
     1.1 --- a/src/audio/coreaudio/SDL_coreaudio.m	Wed May 23 17:15:37 2018 -0700
     1.2 +++ b/src/audio/coreaudio/SDL_coreaudio.m	Thu May 24 07:30:24 2018 -0700
     1.3 @@ -355,7 +355,7 @@
     1.4              return NO;
     1.5          }
     1.6  
     1.7 -        if (open_playback_devices + open_capture_devices == 1) {
     1.8 +        if (open && (open_playback_devices + open_capture_devices) == 1) {
     1.9              if (![session setActive:YES error:&err]) {
    1.10                  NSString *desc = err.description;
    1.11                  SDL_SetError("Could not activate Audio Session: %s", desc.UTF8String);
    1.12 @@ -392,10 +392,10 @@
    1.13              if (this->hidden->interruption_listener != NULL) {
    1.14                  SDLInterruptionListener *listener = nil;
    1.15                  listener = (SDLInterruptionListener *) CFBridgingRelease(this->hidden->interruption_listener);
    1.16 +                [center removeObserver:listener];
    1.17                  @synchronized (listener) {
    1.18                      listener.device = NULL;
    1.19                  }
    1.20 -                [center removeObserver:listener];
    1.21              }
    1.22          }
    1.23      }