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

Fixed distortions when switching to the next file during replay

This commit is contained in:
Klaus Schmidinger 2009-04-18 14:28:15 +02:00
parent fc54164405
commit efd7427bbe
2 changed files with 175 additions and 172 deletions

View File

@ -6045,3 +6045,4 @@ Video Disk Recorder Revision History
values larger than 2GB.
- Added cDevice::NumProvidedSystems() to PLUGINS.html (was missing since it had
been implemented).
- Fixed distortions when switching to the next file during replay.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbplayer.c 2.12 2009/04/13 11:10:50 kls Exp $
* $Id: dvbplayer.c 2.13 2009/04/18 14:18:22 kls Exp $
*/
#include "dvbplayer.h"
@ -398,17 +398,15 @@ void cDvbPlayer::Action(void)
int LastReadIFrame = -1;
int SwitchToPlayFrame = 0;
while (Running() && (NextFile() || readIndex >= 0 || ringBuffer->Available())) {
if (Sleep) {
while (Running()) {
if (WaitingForData)
nonBlockingFileReader->WaitForDataMs(3); // this keeps the CPU load low, but reacts immediately on new data
else
cCondWait::SleepMs(3); // this keeps the CPU load low
else if (Sleep) {
cPoller Poller;
DevicePoll(Poller, 10);
Sleep = false;
}
cPoller Poller;
if (DevicePoll(Poller, 100)) {
{
LOCK_THREAD;
// Read the next frame from the file:
@ -493,6 +491,8 @@ void cDvbPlayer::Action(void)
if (readFrame) {
if (ringBuffer->Put(readFrame))
readFrame = NULL;
else
Sleep = true;
}
}
else
@ -538,6 +538,8 @@ void cDvbPlayer::Action(void)
}
else if (w < 0 && FATALERRNO)
LOG_ERROR;
else
Sleep = true;
}
if (pc <= 0) {
if (!eof || (playDir != pdForward && playFrame->Index() > 0) || (playDir == pdForward && playFrame->Index() < readIndex))