提交 3415960d 编写于 作者: J jp9000

WASAPI: Check the HRESULT values with FAILED

I can't believe I did !res there.  Well I suppose I can believe it, but
still.
上级 bec8a09b
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册