Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed re-setting the audio session category when closing an audio device
  • Loading branch information
slouken committed Feb 14, 2020
1 parent 229c2f8 commit 922b3dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/audio/coreaudio/SDL_coreaudio.m
Expand Up @@ -566,6 +566,12 @@ static BOOL update_audio_session(_THIS, SDL_bool open)
AudioObjectRemovePropertyListener(this->hidden->deviceID, &alive_address, device_unplugged, this);
#endif

if (iscapture) {
open_capture_devices--;
} else {
open_playback_devices--;
}

#if !MACOSX_COREAUDIO
update_audio_session(this, SDL_FALSE);
#endif
Expand All @@ -591,12 +597,6 @@ static BOOL update_audio_session(_THIS, SDL_bool open)
SDL_free(this->hidden->thread_error);
SDL_free(this->hidden->buffer);
SDL_free(this->hidden);

if (iscapture) {
open_capture_devices--;
} else {
open_playback_devices--;
}
}

#if MACOSX_COREAUDIO
Expand Down

0 comments on commit 922b3dc

Please sign in to comment.