aboutsummaryrefslogtreecommitdiff
path: root/src/capture/nvfbc.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-07-05 11:34:34 +0200
committerdec05eba <dec05eba@protonmail.com>2024-07-05 11:34:34 +0200
commit56e9d15e0f9fb5c6ccaa9525dd7ec7a93659f6f7 (patch)
tree08bbb78f6964eb82f812f85e32af97fd22fc63ae /src/capture/nvfbc.c
parent3400f4d5446357945fe5ce87eeb4dba472370a19 (diff)
Fix capture incorrect alignment with cpu encoding for some window sizes
Diffstat (limited to 'src/capture/nvfbc.c')
-rw-r--r--src/capture/nvfbc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c
index b619250..9c7a041 100644
--- a/src/capture/nvfbc.c
+++ b/src/capture/nvfbc.c
@@ -359,11 +359,11 @@ static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec
}
if(cap_nvfbc->capture_region) {
- video_codec_context->width = cap_nvfbc->width & ~1;
- video_codec_context->height = cap_nvfbc->height & ~1;
+ video_codec_context->width = FFALIGN(cap_nvfbc->width, 2);
+ video_codec_context->height = FFALIGN(cap_nvfbc->height, 2);
} else {
- video_codec_context->width = cap_nvfbc->tracking_width & ~1;
- video_codec_context->height = cap_nvfbc->tracking_height & ~1;
+ video_codec_context->width = FFALIGN(cap_nvfbc->tracking_width, 2);
+ video_codec_context->height = FFALIGN(cap_nvfbc->tracking_height, 2);
}
frame->width = video_codec_context->width;