From 5aadfef82b6044b5bc60c9bee609e940707c171e Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 11 Nov 2017 08:11:14 +1000 Subject: [PATCH] ALSA: Fix the returned device count when enumerating devices. --- mini_al.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mini_al.h b/mini_al.h index abde21b6..f22f5fe9 100644 --- a/mini_al.h +++ b/mini_al.h @@ -5670,14 +5670,14 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_ if (includeThisDevice) { -#if 0 +#if 1 printf("NAME: %s\n", NAME); printf("DESC: %s\n", DESC); printf("IOID: %s\n", IOID); char hwid2[256]; 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 char hwid[sizeof(pUniqueIDs->alsa)]; @@ -5745,10 +5745,11 @@ static mal_result mal_enumerate_devices__alsa(mal_context* pContext, mal_device_ pInfo += 1; infoSize -= 1; + *pCount += 1; } + } else { + *pCount += 1; } - - *pCount += 1; } next_device: