From 14d1932de4e969b05308c7cc115b117dcc29db00 Mon Sep 17 00:00:00 2001 From: Raymond Wang Date: Fri, 22 Nov 2024 11:42:40 -0600 Subject: [PATCH 1/2] fix camera crash --- src/mavsdk/plugins/camera/camera_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mavsdk/plugins/camera/camera_impl.cpp b/src/mavsdk/plugins/camera/camera_impl.cpp index a7189f330..e1bfcd96e 100644 --- a/src/mavsdk/plugins/camera/camera_impl.cpp +++ b/src/mavsdk/plugins/camera/camera_impl.cpp @@ -1849,7 +1849,7 @@ bool CameraImpl::get_possible_options( for (const auto& value : values) { std::stringstream ss{}; - ss << value; + ss << value.get_string(); Camera::Option option{}; option.option_id = ss.str(); if (!is_setting_range(setting_id)) { From a0bc0dbeb143c08327d27a628840256a3a379387 Mon Sep 17 00:00:00 2001 From: Raymond Wang Date: Mon, 25 Nov 2024 15:20:37 -0600 Subject: [PATCH 2/2] Remove redundant stringstream --- src/mavsdk/plugins/camera/camera_impl.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mavsdk/plugins/camera/camera_impl.cpp b/src/mavsdk/plugins/camera/camera_impl.cpp index e1bfcd96e..a7acd3c9f 100644 --- a/src/mavsdk/plugins/camera/camera_impl.cpp +++ b/src/mavsdk/plugins/camera/camera_impl.cpp @@ -1848,10 +1848,8 @@ bool CameraImpl::get_possible_options( } for (const auto& value : values) { - std::stringstream ss{}; - ss << value.get_string(); Camera::Option option{}; - option.option_id = ss.str(); + option.option_id = value.get_string(); if (!is_setting_range(setting_id)) { get_option_str(setting_id, option.option_id, option.option_description); }