浏览代码

obs-nvenc-test: Query device info even if NVENC fails

derrod 1 年之前
父节点
当前提交
43e8d02117
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5 5
      plugins/obs-nvenc/obs-nvenc-test/obs-nvenc-test.cpp

+ 5 - 5
plugins/obs-nvenc/obs-nvenc-test/obs-nvenc-test.cpp

@@ -422,17 +422,17 @@ bool nvenc_checks(codec_caps_map &caps, vector<device_info> &device_infos)
 		return false;
 		return false;
 	}
 	}
 
 
-	if (nvenc_ver < NVENC_CONFIGURED_VERSION) {
-		printf("reason=outdated_driver\n");
-		return false;
-	}
-
 	device_infos.resize(cuda_devices);
 	device_infos.resize(cuda_devices);
 	for (int idx = 0; idx < cuda_devices; idx++) {
 	for (int idx = 0; idx < cuda_devices; idx++) {
 		if (get_adapter_caps(idx, caps, device_infos[idx], nvml))
 		if (get_adapter_caps(idx, caps, device_infos[idx], nvml))
 			nvenc_devices++;
 			nvenc_devices++;
 	}
 	}
 
 
+	if (nvenc_ver < NVENC_CONFIGURED_VERSION) {
+		printf("reason=outdated_driver\n");
+		return false;
+	}
+
 	printf("nvenc_devices=%d\n", nvenc_devices);
 	printf("nvenc_devices=%d\n", nvenc_devices);
 	if (!nvenc_devices) {
 	if (!nvenc_devices) {
 		printf("reason=no_supported_devices\n");
 		printf("reason=no_supported_devices\n");