summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2025-05-07 23:06:48 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2025-05-08 10:51:11 +0200
commita79941501716eb65e6d905d2430bddf48887f3f5 (patch)
tree7d061d7e5b37c19d8302b10a3d2319c7f0900291
parente0405b171e928651ed7be5d7ae47b426c07125ff (diff)
apps: qcam: Push the viewfinder role to vectorHEADmaster
In commit ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails"), the viewfinder role is specified as the default if no role is yet chosen. This was unfortunately added by directly accessing the vector rather than extending the size when the vector is empty. Fix the code to push the default viewfinder role on to the back of the vector, increasing the size appropriately. Fixes: ee2b011b65c6 ("apps: cam: Try raw role if default viewfinder role fails") Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Tested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--src/apps/qcam/main_window.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/apps/qcam/main_window.cpp b/src/apps/qcam/main_window.cpp
index 224a7e5a..7e3f3da6 100644
--- a/src/apps/qcam/main_window.cpp
+++ b/src/apps/qcam/main_window.cpp
@@ -357,7 +357,7 @@ int MainWindow::startCapture()
/* Verify roles are supported. */
switch (roles.size()) {
case 0:
- roles[0] = StreamRole::Viewfinder;
+ roles.push_back(StreamRole::Viewfinder);
break;
case 1:
if (roles[0] != StreamRole::Viewfinder) {