From 4016a630be81dfad59bea81d6ff294c4c4846a46 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 8 Jan 2006 11:03:44 +0100 Subject: [PATCH] Added a SleepMs() in cRecorder::Action() to avoid a busy loop --- CONTRIBUTORS | 3 +++ HISTORY | 2 ++ recorder.c | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 36ae8de8..d524a303 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1622,3 +1622,6 @@ Petri Hintukainen Marcel Schaeben for his "Easy Input" patch + +Ingo Schneider + for adding a SleepMs() in cRecorder::Action() to avoid a busy loop diff --git a/HISTORY b/HISTORY index deb44297..90a56b25 100644 --- a/HISTORY +++ b/HISTORY @@ -4131,3 +4131,5 @@ Video Disk Recorder Revision History - Adapted c(Dvb)Device::ProvidesCa() to the dynamic CA handling. - Added a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack() (thanks to Reinhard Nissl). +- Added a SleepMs() in cRecorder::Action() to avoid a busy loop (thanks to Ingo + Schneider). diff --git a/recorder.c b/recorder.c index 35a8e56d..8bb16212 100644 --- a/recorder.c +++ b/recorder.c @@ -4,13 +4,13 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recorder.c 1.16 2005/10/31 12:35:29 kls Exp $ + * $Id: recorder.c 1.17 2006/01/08 11:01:25 kls Exp $ */ +#include "recorder.h" #include #include #include -#include "recorder.h" #define RECORDERBUFSIZE MEGABYTE(5) @@ -171,6 +171,8 @@ void cRecorder::Action(void) int Count = remux->Put(b, r); if (Count) ringBuffer->Del(Count); + else + cCondWait::SleepMs(100); // avoid busy loop when resultBuffer is full in cRemux::Put() } } }