diff options
author | Max Kellermann <max@duempel.org> | 2008-10-29 22:17:42 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-29 22:17:42 +0100 |
commit | 678314534a08dbcbc1c642446f1af899a2108b57 (patch) | |
tree | 494d6e0c776bb914b560f29717f19802daefff53 /src/audio.c | |
parent | 07bb46de88a6af3547d40452771e687a45592404 (diff) | |
download | mpd-678314534a08dbcbc1c642446f1af899a2108b57.tar.gz mpd-678314534a08dbcbc1c642446f1af899a2108b57.tar.xz mpd-678314534a08dbcbc1c642446f1af899a2108b57.zip |
output: always call cancel() before stop()
Stopping an audio output device without cancelling its buffer doesn't
make sense. Combine the two operations, which saves several cancel
calls.
Diffstat (limited to 'src/audio.c')
-rw-r--r-- | src/audio.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/audio.c b/src/audio.c index adc035fd8..5eebc02dd 100644 --- a/src/audio.c +++ b/src/audio.c @@ -193,12 +193,6 @@ isCurrentAudioFormat(const struct audio_format *audioFormat) return audio_format_equals(audioFormat, &input_audio_format); } -static void audio_output_wait(struct audio_output *ao) -{ - while (!audio_output_command_is_finished(ao)) - notify_wait(&audio_output_client_notify); -} - static void audio_output_wait_all(void) { unsigned i; @@ -230,11 +224,8 @@ static void syncAudioDeviceStates(void) audioOutput = &audioOutputArray[i]; if (audioOutput->enabled) audio_output_open(audioOutput, &input_audio_format); - else if (audio_output_is_open(audioOutput)) { - audio_output_cancel(audioOutput); - audio_output_wait(audioOutput); + else if (audio_output_is_open(audioOutput)) audio_output_close(audioOutput); - } } } |