diff options
-rw-r--r-- | audio/coreaudio.c | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/audio/coreaudio.c b/audio/coreaudio.c index a5df950514..79a9d40bf8 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -593,22 +593,20 @@ static void coreaudio_fini_out (HWVoiceOut *hw) int err; coreaudioVoiceOut *core = (coreaudioVoiceOut *) hw; - if (!audio_is_cleaning_up()) { - /* stop playback */ - if (isPlaying(core->outputDeviceID)) { - status = AudioDeviceStop(core->outputDeviceID, core->ioprocid); - if (status != kAudioHardwareNoError) { - coreaudio_logerr (status, "Could not stop playback\n"); - } - } - - /* remove callback */ - status = AudioDeviceDestroyIOProcID(core->outputDeviceID, - core->ioprocid); + /* stop playback */ + if (isPlaying(core->outputDeviceID)) { + status = AudioDeviceStop(core->outputDeviceID, core->ioprocid); if (status != kAudioHardwareNoError) { - coreaudio_logerr (status, "Could not remove IOProc\n"); + coreaudio_logerr(status, "Could not stop playback\n"); } } + + /* remove callback */ + status = AudioDeviceDestroyIOProcID(core->outputDeviceID, + core->ioprocid); + if (status != kAudioHardwareNoError) { + coreaudio_logerr(status, "Could not remove IOProc\n"); + } core->outputDeviceID = kAudioDeviceUnknown; /* destroy mutex */ @@ -633,13 +631,11 @@ static void coreaudio_enable_out(HWVoiceOut *hw, bool enable) } } else { /* stop playback */ - if (!audio_is_cleaning_up()) { - if (isPlaying(core->outputDeviceID)) { - status = AudioDeviceStop(core->outputDeviceID, - core->ioprocid); - if (status != kAudioHardwareNoError) { - coreaudio_logerr (status, "Could not pause playback\n"); - } + if (isPlaying(core->outputDeviceID)) { + status = AudioDeviceStop(core->outputDeviceID, + core->ioprocid); + if (status != kAudioHardwareNoError) { + coreaudio_logerr(status, "Could not pause playback\n"); } } } |