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>
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user