aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms_cuda.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-07-18 06:00:36 +0200
committerdec05eba <dec05eba@protonmail.com>2023-07-18 06:00:36 +0200
commita3beaeb0cc501f654b0b31a52cdc3d9009235aaa (patch)
treeddd3e023fada1e6dfb7e00894d16aefe5fef465b /src/capture/kms_cuda.c
parentd879ccf0fee2ffee3f5f4330a6852dcc2c3bd4fe (diff)
Fix green screen sometimes when capturing amd/intel window
Diffstat (limited to 'src/capture/kms_cuda.c')
-rw-r--r--src/capture/kms_cuda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/capture/kms_cuda.c b/src/capture/kms_cuda.c
index b171421..fc7da5b 100644
--- a/src/capture/kms_cuda.c
+++ b/src/capture/kms_cuda.c
@@ -152,8 +152,8 @@ static int gsr_capture_kms_cuda_start(gsr_capture *cap, AVCodecContext *video_co
cap_kms->capture_pos = monitor.pos;
cap_kms->capture_size = monitor.size;
- video_codec_context->width = max_int(2, cap_kms->capture_size.x & ~1);
- video_codec_context->height = max_int(2, cap_kms->capture_size.y & ~1);
+ video_codec_context->width = max_int(2, even_number_ceil(cap_kms->capture_size.x));
+ video_codec_context->height = max_int(2, even_number_ceil(cap_kms->capture_size.y));
if(!gsr_egl_load(&cap_kms->egl, NULL, true)) {
fprintf(stderr, "gsr error: gsr_capture_kms_cuda_start: failed to load opengl\n");