summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-05-01 03:25:01 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-05-18 20:15:50 +0300
commitba5d2c871acef4bbe6977e93014c8ff1f0a09e7f (patch)
tree8f447015bc90108af49fa9eaf36648eea7e33520
parent0085202fe26c3e96cf0f1dacf52388edf3005c5c (diff)
libcamera: camera: Fix std::ostringstream initialisation
We use the std::ostringstream class to generate log messages in the Camera class. The stream is initialised with initial content, but is not opened without seeking to the end, which results in the content being overwritten immediately. Fix it by opening the stream with std::ios_base::ate. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--src/libcamera/camera.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index fbc66ded..1a21acac 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -560,7 +560,7 @@ Camera::streamConfiguration(const std::vector<StreamUsage> &usages)
CameraConfiguration config = pipe_->streamConfiguration(this, usages);
- std::ostringstream msg("streams configuration:");
+ std::ostringstream msg("streams configuration:", std::ios_base::ate);
unsigned int index = 0;
for (Stream *stream : config) {
@@ -614,7 +614,7 @@ int Camera::configureStreams(const CameraConfiguration &config)
return -EINVAL;
}
- std::ostringstream msg("configuring streams:");
+ std::ostringstream msg("configuring streams:", std::ios_base::ate);
unsigned int index = 0;
for (Stream *stream : config) {