Commit 03390d8b authored by Max Kellermann's avatar Max Kellermann

audio: call closeAudioDevice() on error

Instead of implementing another loop which calls audio_output_close() on all configured devices, simply call closeAudioDevice().
parent 030238bb
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment