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>
This commit is contained in:
Helen Koike 2019-06-25 13:23:53 -03:00 committed by Kieran Bingham
parent cb21bb3311
commit 059ed93beb

View file

@ -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;
}
}