diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2005-05-08 14:07:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2005-05-08 14:07:00 +0200 |
commit | f429e2eab08ba2a07bc791c3fd9f0860d85b82a0 (patch) | |
tree | aeac9d0b5ded1f7c5fca112d00d28ae20c86aaaf /dvbplayer.c | |
parent | 7f5f26020bcedd5a1fd1ae73b8dcebafe2fb9b39 (diff) | |
download | vdr-f429e2eab08ba2a07bc791c3fd9f0860d85b82a0.tar.gz vdr-f429e2eab08ba2a07bc791c3fd9f0860d85b82a0.tar.bz2 |
Moved the sleep in cDvbPlayer::Action() outside the locked area to avoid problems on NPTL systems
Diffstat (limited to 'dvbplayer.c')
-rw-r--r-- | dvbplayer.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dvbplayer.c b/dvbplayer.c index 5d2370cb..e774102e 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 1.32 2005/05/08 13:51:00 kls Exp $ + * $Id: dvbplayer.c 1.33 2005/05/08 14:07:00 kls Exp $ */ #include "dvbplayer.h" @@ -372,9 +372,14 @@ void cDvbPlayer::Action(void) nonBlockingFileReader = new cNonBlockingFileReader; int Length = 0; + bool Sleep = false; running = true; while (running && (NextFile() || readIndex >= 0 || ringBuffer->Available() || !DeviceFlush(100))) { + if (Sleep) { + cCondWait::SleepMs(3); // this keeps the CPU load low + Sleep = false; + } cPoller Poller; if (DevicePoll(Poller, 100)) { @@ -449,7 +454,7 @@ void cDvbPlayer::Action(void) } } else - cCondWait::SleepMs(3); // this keeps the CPU load low + Sleep = true; // Get the next frame from the buffer: |