From b031a7a984a28bf0b415ebf101cf87269a9fec41 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Thu, 24 Oct 2024 21:03:33 +0200 Subject: [PATCH] vtcapture: Relax sleeping Reduces CPU consumption with vsync enabled. On my TV this reduced CPU usage by half by giving up a bit of precision. Also throttle when currentCaptureBuffInfo fails (usually when there is no video) --- src/backends/libvtcapture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/libvtcapture.cpp b/src/backends/libvtcapture.cpp index 69ed7d7..7cce4e8 100644 --- a/src/backends/libvtcapture.cpp +++ b/src/backends/libvtcapture.cpp @@ -266,7 +266,7 @@ int capture_wait(void* state) DBG("Returning with video capture stop (-99), to get restarted in next routine."); return -99; // Restart video capture } else if (ret != 0) { - + usleep(100000); ERR("vtCapture_currentCaptureBuffInfo() failed: %d", ret); return -1; } @@ -280,7 +280,7 @@ int capture_wait(void* state) WARN("captureCurrentBuffInfo() never returned a new plane!"); return -99; // Restart video capture } - usleep(100); + usleep(1000); } self->curr_buff = self->buff.start_addr0;