Commit 5aadfef8 authored by David Reid's avatar David Reid

ALSA: Fix the returned device count when enumerating devices.

parent 3dbaa472
...@@ -5670,14 +5670,14 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_ ...@@ -5670,14 +5670,14 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_
if (includeThisDevice) { if (includeThisDevice) {
#if 0 #if 1
printf("NAME: %s\n", NAME); printf("NAME: %s\n", NAME);
printf("DESC: %s\n", DESC); printf("DESC: %s\n", DESC);
printf("IOID: %s\n", IOID); printf("IOID: %s\n", IOID);
char hwid2[256]; char hwid2[256];
mal_convert_device_name_to_hw_format__alsa(pContext, hwid2, sizeof(hwid2), NAME); mal_convert_device_name_to_hw_format__alsa(pContext, hwid2, sizeof(hwid2), NAME);
printf("DEVICE ID: %s\n\n", hwid2); printf("DEVICE ID: %s (%d)\n\n", hwid2, *pCount);
#endif #endif
char hwid[sizeof(pUniqueIDs->alsa)]; char hwid[sizeof(pUniqueIDs->alsa)];
...@@ -5745,10 +5745,11 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_ ...@@ -5745,10 +5745,11 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_
pInfo += 1; pInfo += 1;
infoSize -= 1; infoSize -= 1;
*pCount += 1;
} }
} else {
*pCount += 1;
} }
*pCount += 1;
} }
next_device: next_device:
......
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