From 54e6a3eb1f84a6020e6b24b61f37344ba6eecb7d Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 28 Feb 2019 18:19:37 +0200 Subject: cam: Don't requeue requests when stopping stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When stopping the stream all pending requests are cancelled, resulting in the request completion signal being emitted with the request status set appropriately. Check the request status in the request completion slot and skip requeuing the request if it has been cancelled. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/main.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/cam') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 13aa3596..1ca7862b 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -102,6 +102,9 @@ static void requestComplete(Request *request, const std::map { static uint64_t last = 0; + if (request->status() == Request::RequestCancelled) + return; + Buffer *buffer = buffers.begin()->second; double fps = buffer->timestamp() - last; -- cgit v1.2.1