From 3415960d0262c0cea2fc2b41ddcfc47357f23f06 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Tue, 4 Mar 2014 07:18:24 -0700 Subject: [PATCH] WASAPI: Check the HRESULT values with FAILED I can't believe I did !res there. Well I suppose I can believe it, but still. --- plugins/win-wasapi/enum-wasapi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/win-wasapi/enum-wasapi.cpp b/plugins/win-wasapi/enum-wasapi.cpp index d0ddc45e5..79a295ef1 100644 --- a/plugins/win-wasapi/enum-wasapi.cpp +++ b/plugins/win-wasapi/enum-wasapi.cpp @@ -45,12 +45,12 @@ void GetWASAPIAudioDevices_(vector &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); -- GitLab