audio: call closeAudioDevice() on error

Instead of implementing another loop which calls audio_output_close()
on all configured devices, simply call closeAudioDevice().
This commit is contained in:
Max Kellermann 2008-10-29 20:39:56 +01:00
parent 030238bb10
commit 03390d8be1
1 changed files with 2 additions and 5 deletions

View File

@ -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;
}