aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-03-31 04:37:44 +0200
committerdec05eba <dec05eba@protonmail.com>2023-03-31 04:37:44 +0200
commit8c6e52631816a0fb50f3277f8ae0fcae1747eeee (patch)
tree42cb8774d9ca88750d6e8685d1cadbaed44bb263
parent55b28133096701a2ba0cc2e658436a5ee33173d1 (diff)
Make sure region size for focused window is divisable by 2
-rw-r--r--src/capture/xcomposite_cuda.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/capture/xcomposite_cuda.c b/src/capture/xcomposite_cuda.c
index 1ce80f5..a812c12 100644
--- a/src/capture/xcomposite_cuda.c
+++ b/src/capture/xcomposite_cuda.c
@@ -210,8 +210,8 @@ static int gsr_capture_xcomposite_cuda_start(gsr_capture *cap, AVCodecContext *v
video_codec_context->height = cap_xcomp->texture_size.y;
if(cap_xcomp->params.region_size.x > 0 && cap_xcomp->params.region_size.y) {
- video_codec_context->width = cap_xcomp->params.region_size.x;
- video_codec_context->height = cap_xcomp->params.region_size.y;
+ video_codec_context->width = max_int(2, cap_xcomp->params.region_size.x & ~1);
+ video_codec_context->height = max_int(2, cap_xcomp->params.region_size.y & ~1);
}
cap_xcomp->target_texture_id = gl_create_texture(cap_xcomp, video_codec_context->width, video_codec_context->height);