summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2020-07-06 14:52:54 +0100
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-10 23:17:17 +0900
commitd76acac30dc714e63057ee0cc424b12624994072 (patch)
tree16a8e42a40577631be824176f267fd00d786c1b6 /src
parente37e72c61c1021c1a19e031066c11569f948d9d2 (diff)
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 <paul.elder@ideasonboard.com> Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp2
1 files changed, 1 insertions, 1 deletions
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<double>::max(), score;
V4L2DeviceFormat bestMode = {};
#define PENALTY_AR 1500.0