Commit af3f01ca authored by David Reid's avatar David Reid

sndio: Fix unnecessarily inefficient device enumeration.

parent 9690e3bb
...@@ -15398,7 +15398,10 @@ mal_result mal_context_enumerate_devices__sndio(mal_context* pContext, mal_enum_ ...@@ -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); mal_itoa_s(iDevice, devpath+strlen(devpath), sizeof(devpath)-strlen(devpath), 10);
struct stat st; 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 // 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. // via the sndio API by using the "snd/N" format for the device name.
char devid[256]; char devid[256];
...@@ -15444,7 +15447,6 @@ mal_result mal_context_enumerate_devices__sndio(mal_context* pContext, mal_enum_ ...@@ -15444,7 +15447,6 @@ mal_result mal_context_enumerate_devices__sndio(mal_context* pContext, mal_enum_
break; break;
} }
} }
}
return MAL_SUCCESS; return MAL_SUCCESS;
#else #else
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