Commit 2b167eb1 authored by David Reid's avatar David Reid

audioio: Fix unnecessarily inefficient device enumeration.

parent af3f01ca
......@@ -15398,7 +15398,7 @@ mal_result mal_context_enumerate_devices__sndio(mal_context* pContext, mal_enum_
mal_itoa_s(iDevice, devpath+strlen(devpath), sizeof(devpath)-strlen(devpath), 10);
struct stat st;
if (stat(devpath, &st) != 0) {
if (stat(devpath, &st) < 0) {
break;
}
......@@ -16095,7 +16095,10 @@ mal_result mal_context_enumerate_devices__audioio(mal_context* pContext, mal_enu
mal_itoa_s(iDevice, devpath+strlen(devpath), sizeof(devpath)-strlen(devpath), 10);
struct stat st;
if (stat(devpath, &st) == 0) {
if (stat(devpath, &st) < 0) {
break;
}
// The device exists, but we need to check if it's usable as playback and/or capture.
int fd;
mal_bool32 isTerminating = MAL_FALSE;
......@@ -16136,7 +16139,6 @@ mal_result mal_context_enumerate_devices__audioio(mal_context* pContext, mal_enu
break;
}
}
}
return MAL_SUCCESS;
}
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