From 8c6e52631816a0fb50f3277f8ae0fcae1747eeee Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 31 Mar 2023 04:37:44 +0200 Subject: Make sure region size for focused window is divisable by 2 --- src/capture/xcomposite_cuda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/capture') 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); -- cgit v1.2.3