Selaa lähdekoodia

WASAPI: Check the HRESULT values with FAILED

I can't believe I did !res there.  Well I suppose I can believe it, but
still.
jp9000 11 vuotta sitten
vanhempi
sitoutus
3415960d02
1 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 2 2
      plugins/win-wasapi/enum-wasapi.cpp

+ 2 - 2
plugins/win-wasapi/enum-wasapi.cpp

@@ -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);