aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-29 20:39:56 +0100
committerMax Kellermann <max@duempel.org>2008-10-29 20:39:56 +0100
commit03390d8be1cb8983778faf6eedb9bcfd26a6dbce (patch)
treea47f82e44dba4e18980300fd08fb308daac04848
parent030238bb1035acc825cebe793be51eb034f92e4f (diff)
downloadmpd-03390d8be1cb8983778faf6eedb9bcfd26a6dbce.tar.gz
mpd-03390d8be1cb8983778faf6eedb9bcfd26a6dbce.tar.xz
mpd-03390d8be1cb8983778faf6eedb9bcfd26a6dbce.zip
audio: call closeAudioDevice() on error
Instead of implementing another loop which calls audio_output_close() on all configured devices, simply call closeAudioDevice().
Diffstat (limited to '')
-rw-r--r--src/audio.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/audio.c b/src/audio.c
index cd029c09b..0eff63f8f 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -313,12 +313,9 @@ int openAudioDevice(const struct audio_format *audioFormat)
ret = 0;
}
- if (ret != 0) {
+ if (ret != 0)
/* close all devices if there was an error */
- for (i = 0; i < audioOutputArraySize; ++i) {
- audio_output_close(&audioOutputArray[i]);
- }
- }
+ closeAudioDevice();
return ret;
}