summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-07-27 12:00:30 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2002-07-27 12:00:30 +0200
commit4524f8f81403bb2b446eac2c8e0ad0bd2981075f (patch)
tree8d62dbd392f8d29732d01883cf5607daf6a82455
parent771f0150b4de3209d9b1b788f15c8906333884fa (diff)
downloadvdr-4524f8f81403bb2b446eac2c8e0ad0bd2981075f.tar.gz
vdr-4524f8f81403bb2b446eac2c8e0ad0bd2981075f.tar.bz2
Re-visited the race condition fix in the cDvbPlayer
-rw-r--r--HISTORY5
-rw-r--r--config.h4
-rw-r--r--dvbplayer.c12
3 files changed, 15 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index 225e8d8b..7f6700da 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1378,3 +1378,8 @@ Video Disk Recorder Revision History
- Fixed a possible race condition in the cDvbPlayer (thanks to Andreas Schultz
for pointing out this one).
- 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).
diff --git a/config.h b/config.h
index f10b83d4..abfbe95d 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* 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
@@ -19,7 +19,7 @@
#include "eit.h"
#include "tools.h"
-#define VDRVERSION "1.1.5"
+#define VDRVERSION "1.1.6"
#define MAXPRIORITY 99
#define MAXLIFETIME 99
diff --git a/dvbplayer.c b/dvbplayer.c
index af6b28da..1b608dda 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.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"
@@ -90,6 +90,7 @@ private:
int replayFile;
bool eof;
bool active;
+ bool running;
ePlayModes playMode;
ePlayDirs playDir;
int trickSpeed;
@@ -133,6 +134,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
index = NULL;
eof = false;
active = true;
+ running = false;
playMode = pmPlay;
playDir = pdForward;
trickSpeed = NORMAL_SPEED;
@@ -285,8 +287,9 @@ void cDvbPlayer::Activate(bool On)
Start();
}
else if (active) {
- active = false;
+ running = false;
Cancel(3);
+ active = false;
}
}
@@ -308,7 +311,8 @@ void cDvbPlayer::Action(void)
if (readIndex >= 0)
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!
{
LOCK_THREAD;
@@ -414,9 +418,9 @@ void cDvbPlayer::Action(void)
break;
}
}
+ active = running = false;
dsyslog("dvbplayer thread ended (pid=%d)", getpid());
- active = false;
}
void cDvbPlayer::Pause(void)