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

View File

@@ -313,12 +313,9 @@ int openAudioDevice(const struct audio_format *audioFormat)
ret = 0; ret = 0;
} }
if (ret != 0) { if (ret != 0)
/* close all devices if there was an error */ /* close all devices if there was an error */
for (i = 0; i < audioOutputArraySize; ++i) { closeAudioDevice();
audio_output_close(&audioOutputArray[i]);
}
}
return ret; return ret;
} }