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

Re-visited the race condition fix in the cDvbPlayer

This commit is contained in:
Klaus Schmidinger 2002-07-27 12:00:30 +02:00
parent 771f0150b4
commit 4524f8f814
3 changed files with 15 additions and 6 deletions

View File

@ -1378,3 +1378,8 @@ Video Disk Recorder Revision History
- Fixed a possible race condition in the cDvbPlayer (thanks to Andreas Schultz - Fixed a possible race condition in the cDvbPlayer (thanks to Andreas Schultz
for pointing out this one). for pointing out this one).
- Disabled channels on Transponder 12070 in 'channels.conf', which apparently no longer transmits. - Disabled channels on Transponder 12070 in 'channels.conf', which apparently no longer transmits.
2002-07-27: Version 1.1.6
- Re-visited the race condition fix in the cDvbPlayer (thanks again to Andreas
Schultz).

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: config.h 1.120 2002/07/13 09:46:59 kls Exp $ * $Id: config.h 1.121 2002/07/27 12:00:30 kls Exp $
*/ */
#ifndef __CONFIG_H #ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "1.1.5" #define VDRVERSION "1.1.6"
#define MAXPRIORITY 99 #define MAXPRIORITY 99
#define MAXLIFETIME 99 #define MAXLIFETIME 99

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.7 2002/07/14 14:30:36 kls Exp $ * $Id: dvbplayer.c 1.8 2002/07/27 11:57:48 kls Exp $
*/ */
#include "dvbplayer.h" #include "dvbplayer.h"
@ -90,6 +90,7 @@ private:
int replayFile; int replayFile;
bool eof; bool eof;
bool active; bool active;
bool running;
ePlayModes playMode; ePlayModes playMode;
ePlayDirs playDir; ePlayDirs playDir;
int trickSpeed; int trickSpeed;
@ -133,6 +134,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
index = NULL; index = NULL;
eof = false; eof = false;
active = true; active = true;
running = false;
playMode = pmPlay; playMode = pmPlay;
playDir = pdForward; playDir = pdForward;
trickSpeed = NORMAL_SPEED; trickSpeed = NORMAL_SPEED;
@ -285,8 +287,9 @@ void cDvbPlayer::Activate(bool On)
Start(); Start();
} }
else if (active) { else if (active) {
active = false; running = false;
Cancel(3); Cancel(3);
active = false;
} }
} }
@ -308,7 +311,8 @@ void cDvbPlayer::Action(void)
if (readIndex >= 0) if (readIndex >= 0)
isyslog("resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true)); isyslog("resuming replay at index %d (%s)", readIndex, IndexToHMSF(readIndex, true));
while (active && NextFile()) { running = true;
while (running && NextFile()) {
pfd[1].fd = replayFile; // NextFile() may have returned a new file handle! pfd[1].fd = replayFile; // NextFile() may have returned a new file handle!
{ {
LOCK_THREAD; LOCK_THREAD;
@ -414,9 +418,9 @@ void cDvbPlayer::Action(void)
break; break;
} }
} }
active = running = false;
dsyslog("dvbplayer thread ended (pid=%d)", getpid()); dsyslog("dvbplayer thread ended (pid=%d)", getpid());
active = false;
} }
void cDvbPlayer::Pause(void) void cDvbPlayer::Pause(void)