diff options
author | Stefan Klug <stefan.klug@ideasonboard.com> | 2024-06-28 11:36:02 +0200 |
---|---|---|
committer | Stefan Klug <stefan.klug@ideasonboard.com> | 2024-06-28 12:53:55 +0200 |
commit | 9411578be8c84c9e5727dbde9e51a885c6e9fea1 (patch) | |
tree | 57ea6fbf9dd0e358408605f642d4cd70dd2ae8b7 /src/ipa/libipa | |
parent | 36a4f67a755ef54d81944ae6d8b11685e5a41a28 (diff) |
libcamera: Fix maybe-uninitialized error
The gcc used in my current buildroot (Version 12.3) errors out with
-Wmaybe-uninitialized. Fix that.
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src/ipa/libipa')
-rw-r--r-- | src/ipa/libipa/exposure_mode_helper.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ipa/libipa/exposure_mode_helper.cpp b/src/ipa/libipa/exposure_mode_helper.cpp index 683a564a..7703becc 100644 --- a/src/ipa/libipa/exposure_mode_helper.cpp +++ b/src/ipa/libipa/exposure_mode_helper.cpp @@ -166,7 +166,7 @@ ExposureModeHelper::splitExposure(utils::Duration exposure) const return { minShutter_, minGain_, exposure / (minShutter_ * minGain_) }; utils::Duration shutter; - double stageGain; + double stageGain = 1.0; double gain; for (unsigned int stage = 0; stage < gains_.size(); stage++) { @@ -201,12 +201,9 @@ ExposureModeHelper::splitExposure(utils::Duration exposure) const * From here on all we can do is max out the shutter time, followed by * the analogue gain. If we still haven't achieved the target we send * the rest of the exposure time to digital gain. If we were given no - * stages to use then set stageGain to 1.0 so that shutter time is maxed - * before gain touched at all. + * stages to use then the default stageGain of 1.0 is used so that + * shutter time is maxed before gain is touched at all. */ - if (gains_.empty()) - stageGain = 1.0; - shutter = clampShutter(exposure / clampGain(stageGain)); gain = clampGain(exposure / shutter); |