From b2644a9881ea65ff64234953fcd97664a60b98af Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 18 Jul 2023 03:21:16 +0200 Subject: Fix wayland capture on amd/intel --- src/capture/kms_cuda.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/capture/kms_cuda.c') 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"); } -- cgit v1.2.3