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:
parent
030238bb10
commit
03390d8be1
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue