summaryrefslogtreecommitdiff
path: root/dvbplayer.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-02-19 11:50:20 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-02-19 11:50:20 +0100
commit23ec57d8229be5c0a2eaa12fa313ceb8b49fc962 (patch)
treedf01fdf5fe16d652783aec64320c7fcf98464dd9 /dvbplayer.c
parent50e09d1232c8d01a8a3f570aa8b3044f8d46a2e6 (diff)
downloadvdr-23ec57d8229be5c0a2eaa12fa313ceb8b49fc962.tar.gz
vdr-23ec57d8229be5c0a2eaa12fa313ceb8b49fc962.tar.bz2
Fixed switching into time shift mode when pausing live video1.7.24
Diffstat (limited to 'dvbplayer.c')
-rw-r--r--dvbplayer.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/dvbplayer.c b/dvbplayer.c
index d644e203..b0adac40 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 2.22 2012/02/17 15:36:41 kls Exp $
+ * $Id: dvbplayer.c 2.23 2012/02/19 10:48:02 kls Exp $
*/
#include "dvbplayer.h"
@@ -216,6 +216,7 @@ private:
cUnbufferedFile *replayFile;
double framesPerSecond;
bool isPesRecording;
+ bool pauseLive;
bool eof;
bool firstPacket;
ePlayModes playMode;
@@ -235,7 +236,7 @@ protected:
virtual void Activate(bool On);
virtual void Action(void);
public:
- cDvbPlayer(const char *FileName);
+ cDvbPlayer(const char *FileName, bool PauseLive);
virtual ~cDvbPlayer();
bool Active(void) { return cThread::Running(); }
void Pause(void);
@@ -256,7 +257,7 @@ public:
#define SPEED_MULT 12 // the speed multiplier
int cDvbPlayer::Speeds[] = { 0, -2, -4, -8, 1, 2, 4, 12, 0 };
-cDvbPlayer::cDvbPlayer(const char *FileName)
+cDvbPlayer::cDvbPlayer(const char *FileName, bool PauseLive)
:cThread("dvbplayer")
{
nonBlockingFileReader = NULL;
@@ -265,6 +266,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
cRecording Recording(FileName);
framesPerSecond = Recording.FramesPerSecond();
isPesRecording = Recording.IsPesRecording();
+ pauseLive = PauseLive;
eof = false;
firstPacket = true;
playMode = pmPlay;
@@ -282,7 +284,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName)
return;
ringBuffer = new cRingBufferFrame(PLAYERBUFSIZE);
// Create the index file:
- index = new cIndexFile(FileName, false, isPesRecording);
+ index = new cIndexFile(FileName, false, isPesRecording, pauseLive);
if (!index)
esyslog("ERROR: can't allocate index");
else if (!index->Ok()) {
@@ -407,6 +409,8 @@ void cDvbPlayer::Action(void)
int LastReadIFrame = -1;
int SwitchToPlayFrame = 0;
+ if (pauseLive)
+ Goto(0, true);
while (Running()) {
if (WaitingForData)
nonBlockingFileReader->WaitForDataMs(10); // this keeps the CPU load low, but reacts immediately on new data
@@ -414,7 +418,7 @@ void cDvbPlayer::Action(void)
cPoller Poller;
DevicePoll(Poller, 10);
Sleep = false;
- if (playMode == pmStill || playMode==pmPause)
+ if (playMode == pmStill || playMode == pmPause)
cCondWait::SleepMs(10);
}
{
@@ -836,8 +840,8 @@ bool cDvbPlayer::GetReplayMode(bool &Play, bool &Forward, int &Speed)
// --- cDvbPlayerControl -----------------------------------------------------
-cDvbPlayerControl::cDvbPlayerControl(const char *FileName)
-:cControl(player = new cDvbPlayer(FileName))
+cDvbPlayerControl::cDvbPlayerControl(const char *FileName, bool PauseLive)
+:cControl(player = new cDvbPlayer(FileName, PauseLive))
{
}