浏览代码

win-wasapi: Only enable work queue on Windows 10+

Fixes #5967
Matt Gajownik 3 年之前
父节点
当前提交
02f80a1013
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      plugins/win-wasapi/win-wasapi.cpp

+ 7 - 1
plugins/win-wasapi/win-wasapi.cpp

@@ -7,6 +7,7 @@
 #include <util/windows/ComPtr.hpp>
 #include <util/windows/ComPtr.hpp>
 #include <util/windows/WinHandle.hpp>
 #include <util/windows/WinHandle.hpp>
 #include <util/windows/CoTaskMemPtr.hpp>
 #include <util/windows/CoTaskMemPtr.hpp>
+#include <util/windows/win-version.h>
 #include <util/threading.h>
 #include <util/threading.h>
 #include <util/util_uint64.h>
 #include <util/util_uint64.h>
 
 
@@ -324,7 +325,12 @@ WASAPISource::WASAPISource(obs_data_t *settings, obs_source_t *source_,
 
 
 	/* OBS will already load DLL on startup if it exists */
 	/* OBS will already load DLL on startup if it exists */
 	const HMODULE rtwq_module = GetModuleHandle(L"RTWorkQ.dll");
 	const HMODULE rtwq_module = GetModuleHandle(L"RTWorkQ.dll");
-	rtwq_supported = rtwq_module != NULL;
+
+	// while RTWQ was introduced in Win 8.1, it silently fails
+	// to capture Desktop Audio for some reason. Disable for now.
+	if (get_win_ver_int() >= _WIN32_WINNT_WIN10)
+		rtwq_supported = rtwq_module != NULL;
+
 	if (rtwq_supported) {
 	if (rtwq_supported) {
 		rtwq_unlock_work_queue =
 		rtwq_unlock_work_queue =
 			(PFN_RtwqUnlockWorkQueue)GetProcAddress(
 			(PFN_RtwqUnlockWorkQueue)GetProcAddress(