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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user