windows: directsound should also map audio device GUIDs to proper names.

Moved this code from winmm into core so both can use it.

DirectSound (at least on Win10) also returns truncated device names, even
though it's handed in as a string pointer and not a static-sized buffer.  :/
This commit is contained in:
Ryan C. Gordon
2016-08-10 15:34:24 -04:00
parent b879595a2a
commit 21c7fe0060
4 changed files with 79 additions and 73 deletions

View File

@@ -155,7 +155,7 @@ FindAllDevs(LPGUID guid, LPCWSTR desc, LPCWSTR module, LPVOID data)
{
const int iscapture = (int) ((size_t) data);
if (guid != NULL) { /* skip default device */
char *str = WIN_StringToUTF8(desc);
char *str = WIN_LookupAudioDeviceName(desc, guid);
if (str != NULL) {
LPGUID cpyguid = (LPGUID) SDL_malloc(sizeof (GUID));
SDL_memcpy(cpyguid, guid, sizeof (GUID));