From d76acac30dc714e63057ee0cc424b12624994072 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Mon, 6 Jul 2020 14:52:54 +0100 Subject: libcamera: pipeline: raspberrypi: Fix initial value for scoring routine Use std::numerical_limits to initialise the best score instead of an arbitrary value. This fixes a failure in v4l2-conformance when using the Raspberry Pi pipeline handler and v4l2-compatibility libcamera layer. Reported-by: Paul Elder Signed-off-by: Naushir Patuck Reviewed-by: Paul Elder Signed-off-by: Paul Elder --- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libcamera/pipeline/raspberrypi') diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index a08ad6a8..c6cb84e0 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -69,7 +69,7 @@ double scoreFormat(double desired, double actual) V4L2DeviceFormat findBestMode(V4L2PixFmtMap &formatsMap, const Size &req) { - double bestScore = 9e9, score; + double bestScore = std::numeric_limits::max(), score; V4L2DeviceFormat bestMode = {}; #define PENALTY_AR 1500.0 -- cgit v1.2.1