From d19f5d2d81edc38a421e0e7bbfbe3f0238e17da9 Mon Sep 17 00:00:00 2001 From: klemek Date: Sun, 23 Nov 2025 19:11:08 +0100 Subject: [PATCH] fix(video): slightly faster video --- src/video.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/video.c b/src/video.c index e8e15b4..ea77365 100644 --- a/src/video.c +++ b/src/video.c @@ -275,13 +275,13 @@ static void close_stream(const VideoCapture *video_capture) { } static bool read_video(VideoCapture *video_capture) { - bool result; + if (ioctl(video_capture->fd, VIDIOC_DQBUF, &video_capture->buf) != -1) { + ioctl(video_capture->fd, VIDIOC_QBUF, &video_capture->buf); - result = ioctl(video_capture->fd, VIDIOC_DQBUF, &video_capture->buf) != -1; + return true; + } - ioctl(video_capture->fd, VIDIOC_QBUF, &video_capture->buf); - - return result; + return false; } void video_init(VideoCapture *video_capture, const char *name,