aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms_cuda.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-07-18 03:21:16 +0200
committerdec05eba <dec05eba@protonmail.com>2023-07-18 03:21:16 +0200
commitb2644a9881ea65ff64234953fcd97664a60b98af (patch)
tree4938f694baa1f5e9541043285d819863cff93b0d /src/capture/kms_cuda.c
parent0a2806972f51109024a114a1c8ad5396e9d535c7 (diff)
Fix wayland capture on amd/intel
Diffstat (limited to 'src/capture/kms_cuda.c')
-rw-r--r--src/capture/kms_cuda.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/capture/kms_cuda.c b/src/capture/kms_cuda.c
index 7569cd2..b171421 100644
--- a/src/capture/kms_cuda.c
+++ b/src/capture/kms_cuda.c
@@ -119,13 +119,12 @@ static void monitor_callback(const gsr_monitor *monitor, void *userdata) {
if(monitor_callback_userdata->monitor_to_capture_len != monitor->name_len || memcmp(monitor_callback_userdata->monitor_to_capture, monitor->name, monitor->name_len) != 0)
return;
- const int connector_index = monitor_callback_userdata->cap_kms->monitor_id.num_connector_ids;
- if(connector_index < MAX_CONNECTOR_IDS) {
- monitor_callback_userdata->cap_kms->monitor_id.connector_ids[connector_index] = monitor->connector_id;
+ if(monitor_callback_userdata->cap_kms->monitor_id.num_connector_ids < MAX_CONNECTOR_IDS) {
+ monitor_callback_userdata->cap_kms->monitor_id.connector_ids[monitor_callback_userdata->cap_kms->monitor_id.num_connector_ids] = monitor->connector_id;
++monitor_callback_userdata->cap_kms->monitor_id.num_connector_ids;
}
- if(connector_index == MAX_CONNECTOR_IDS)
+ if(monitor_callback_userdata->cap_kms->monitor_id.num_connector_ids == MAX_CONNECTOR_IDS)
fprintf(stderr, "gsr warning: reached max connector ids\n");
}