summaryrefslogtreecommitdiff
path: root/src/cam
diff options
context:
space:
mode:
authorHelen Koike <helen.koike@collabora.com>2019-06-25 13:23:53 -0300
committerKieran Bingham <kieran.bingham@ideasonboard.com>2019-06-25 20:40:41 +0100
commit059ed93bebbac5710fffd4714ee20cc02d3212aa (patch)
tree681f4941498645088fb492d186d2c497e8771e83 /src/cam
parentcb21bb33118e4b172d64cd4abb4f19caeb342707 (diff)
cam: capture: Stop stream when queueRequest() fails
queueRequest() is called after starting the stream. If it fails, the stream should be stopped, otherwise it can get a "Device or resource busy" error, due to VIDIOC_REQBUFS ioctls being called after VIDIOC_STREAMON without VIDIOC_STREAMOFF in-between. Signed-off-by: Helen Koike <helen.koike@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam')
-rw-r--r--src/cam/capture.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index e455612b..6b842d73 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -117,6 +117,7 @@ int Capture::capture(EventLoop *loop)
ret = camera_->queueRequest(request);
if (ret < 0) {
std::cerr << "Can't queue request" << std::endl;
+ camera_->stop();
return ret;
}
}