From a24e100983cbbf25e4fcc6d3eaeaaf440db71e38 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 23 Feb 2023 15:27:18 +0100 Subject: [PATCH] camera: fix output matches to find close-by resolutions --- device/camera/camera_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/camera/camera_output.c b/device/camera/camera_output.c index 9e72899..02f8a7e 100644 --- a/device/camera/camera_output.c +++ b/device/camera/camera_output.c @@ -16,7 +16,7 @@ static bool camera_output_matches_capture(buffer_list_t *capture, unsigned target_height, unsigned format) { - if (target_height && (capture->fmt.height / MATCH_ALIGN_SIZE) != (target_height / MATCH_ALIGN_SIZE)) { + if (target_height && abs(capture->fmt.height - target_height) > MATCH_ALIGN_SIZE) { return false; }