From aaa31d987f92f767af0d5d9633da5bab9d7862b8 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 2 Nov 2018 00:42:50 -0700 Subject: Check the correct propvariant object --- Alc/backends/wasapi.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc/backends') diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp index a390911b..a32f41ac 100644 --- a/Alc/backends/wasapi.cpp +++ b/Alc/backends/wasapi.cpp @@ -117,7 +117,7 @@ std::vector PlaybackDevices; std::vector CaptureDevices; -std::string wstr_to_string(const WCHAR *wstr) +std::string wstr_to_utf8(const WCHAR *wstr) { std::string ret; @@ -200,7 +200,7 @@ static NameGUIDPair get_device_name_and_guid(IMMDevice *device) name += "Unknown Device Name"; } else if(pvname.vt == VT_LPWSTR) - name += wstr_to_string(pvname.pwszVal); + name += wstr_to_utf8(pvname.pwszVal); else { WARN("Unexpected PROPVARIANT type: 0x%04x\n", pvname.vt); @@ -218,8 +218,8 @@ static NameGUIDPair get_device_name_and_guid(IMMDevice *device) WARN("GetValue AudioEndpoint_GUID failed: 0x%08lx\n", hr); guid = "Unknown Device GUID"; } - else if(pvname.vt == VT_LPWSTR) - guid = wstr_to_string(pvname.pwszVal); + else if(pvguid.vt == VT_LPWSTR) + guid = wstr_to_utf8(pvguid.pwszVal); else { WARN("Unexpected PROPVARIANT type: 0x%04x\n", pvguid.vt); -- cgit v1.2.3