diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-02-19 17:16:19 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-02-25 23:13:33 +0100 |
commit | dd14f1ec2cb772d731570df54bbc9e10eae9e018 (patch) | |
tree | c4cca71da6a3b5f27fdf7bdbe89784b18157fe9b | |
parent | 24cb5638533d19f77dd2f7f629f05eb07484ab97 (diff) |
cam: improve error checking when capturing
The return value when start() and stop() the camera should be checked
and handled.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/cam/main.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 0c66a98e..70d86bcf 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -180,11 +180,18 @@ static int capture() } std::cout << "Capture until user interrupts by SIGINT" << std::endl; - camera->start(); + + ret = camera->start(); + if (ret) { + std::cout << "Failed to start capture" << std::endl; + goto out; + } ret = loop->exec(); - camera->stop(); + ret = camera->stop(); + if (ret) + std::cout << "Failed to stop capture" << std::endl; out: camera->freeBuffers(); |