sndio: Fix unnecessarily inefficient device enumeration.

This commit is contained in:
David Reid
2018-07-30 12:09:07 +10:00
parent 9690e3bb9e
commit af3f01ca6f
+4 -2
View File
@@ -15398,7 +15398,10 @@ 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;
}
// The device exists, but we need to check if it's usable as playback and/or capture. This is done
// via the sndio API by using the "snd/N" format for the device name.
char devid[256];
@@ -15444,7 +15447,6 @@ mal_result mal_context_enumerate_devices__sndio(mal_context* pContext, mal_enum_
break;
}
}
}
return MAL_SUCCESS;
#else