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:
parent
cb21bb3311
commit
059ed93beb
1 changed files with 1 additions and 0 deletions
|
@ -117,6 +117,7 @@ int Capture::capture(EventLoop *loop)
|
||||||
ret = camera_->queueRequest(request);
|
ret = camera_->queueRequest(request);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
std::cerr << "Can't queue request" << std::endl;
|
std::cerr << "Can't queue request" << std::endl;
|
||||||
|
camera_->stop();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue