WASAPI: Check the HRESULT values with FAILED

I can't believe I did !res there.  Well I suppose I can believe it, but
still.
This commit is contained in:
jp9000
2014-03-04 07:18:24 -07:00
parent bec8a09bd9
commit 3415960d02

View File

@@ -45,12 +45,12 @@ void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
res = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL,
__uuidof(IMMDeviceEnumerator),
(void**)enumerator.Assign());
if (!res)
if (FAILED(res))
throw HRError("Failed to create enumerator", res);
res = enumerator->EnumAudioEndpoints(input ? eCapture : eRender,
DEVICE_STATE_ACTIVE, collection.Assign());
if (!res)
if (FAILED(res))
throw HRError("Failed to enumerate devices", res);
res = collection->GetCount(&count);