libcamera: Don't copy StreamConfiguration when iterating
A copy is made in the range-based for loop, and thus all modifications done in the for loop body are lost, and not actually applied to the object in the container. Fix that by taking a reference in the range-based for loop. Fixes:4217c9f1aa("libcamera: camera: Zero streams before validate()") Fixes:613d540267("pipeline: raspberrypi: Fix handling of colour spaces") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
5d4b7e4b5b
commit
4e557e544b
@@ -1178,8 +1178,8 @@ int Camera::configure(CameraConfiguration *config)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
for (auto it : *config)
|
||||
it.setStream(nullptr);
|
||||
for (auto &cfg : *config)
|
||||
cfg.setStream(nullptr);
|
||||
|
||||
if (config->validate() != CameraConfiguration::Valid) {
|
||||
LOG(Camera, Error)
|
||||
|
||||
Reference in New Issue
Block a user