1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Moved the sleep in cDvbPlayer::Action() outside the locked area to avoid problems on NPTL systems

This commit is contained in:
Klaus Schmidinger 2005-05-08 14:07:00 +02:00
parent 7f5f26020b
commit f429e2eab0

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "dvbplayer.h"
@ -372,9 +372,14 @@ void cDvbPlayer::Action(void)
nonBlockingFileReader = new cNonBlockingFileReader; nonBlockingFileReader = new cNonBlockingFileReader;
int Length = 0; int Length = 0;
bool Sleep = false;
running = true; running = true;
while (running && (NextFile() || readIndex >= 0 || ringBuffer->Available() || !DeviceFlush(100))) { while (running && (NextFile() || readIndex >= 0 || ringBuffer->Available() || !DeviceFlush(100))) {
if (Sleep) {
cCondWait::SleepMs(3); // this keeps the CPU load low
Sleep = false;
}
cPoller Poller; cPoller Poller;
if (DevicePoll(Poller, 100)) { if (DevicePoll(Poller, 100)) {
@ -449,7 +454,7 @@ void cDvbPlayer::Action(void)
} }
} }
else else
cCondWait::SleepMs(3); // this keeps the CPU load low Sleep = true;
// Get the next frame from the buffer: // Get the next frame from the buffer: