Fix capture incorrect alignment with cpu encoding for some window sizes

This commit is contained in:
dec05eba
2024-07-05 11:34:34 +02:00
parent 3400f4d544
commit 56e9d15e0f
5 changed files with 33 additions and 42 deletions

View File

@@ -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;