From 6a5d416b3793401d8bad6e3d398847eeb1158ba0 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Tue, 23 Jun 2020 14:33:39 +0900 Subject: v4l2: v4l2_camera_proxy: noop if streamon when stream is already on If VIDIOC_STREMAON is called when the stream is already on, do a noop. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/v4l2') diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 08fd3fdc..225ce42b 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -623,6 +623,9 @@ int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg) if (!hasOwnership(file)) return -EBUSY; + if (vcam_->isRunning()) + return 0; + currentBuf_ = 0; return vcam_->streamOn(); -- cgit v1.2.1