From 834ac04c3be267ecfb463a9741782bf315130404 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 23 Dec 2016 14:49:06 +0100 Subject: [PATCH] Added a short sleep to cTSBuffer::Action() to avoid high CPU usage --- CONTRIBUTORS | 1 + HISTORY | 2 ++ device.c | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9b5448e1..ca58ae8e 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3458,3 +3458,4 @@ Aitugan Sarbassov Sergey Chernyavskiy for reporting truncated date/time strings in the skins on multi-byte UTF-8 + for adding a short sleep to cTSBuffer::Action() to avoid high CPU usage diff --git a/HISTORY b/HISTORY index 93fa8989..3c37db26 100644 --- a/HISTORY +++ b/HISTORY @@ -8879,3 +8879,5 @@ Video Disk Recorder Revision History - Avoiding some duplicate code and unnecessary work in nit.c (thanks to Ville Skyttä). - Added support for the systemd watchdog (thanks to Marc Perrudin), +- Added a short sleep to cTSBuffer::Action() to avoid high CPU usage (thanks to + Sergey Chernyavskiy). diff --git a/device.c b/device.c index 174281f4..3c97b8ce 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 4.2 2015/09/05 11:42:17 kls Exp $ + * $Id: device.c 4.3 2016/12/23 14:43:44 kls Exp $ */ #include "device.h" @@ -1768,6 +1768,7 @@ void cTSBuffer::Action(void) break; } } + cCondWait::SleepMs(10); // avoids small chunks of data, which cause high CPU usage, esp. on ARM CPUs } } }