summaryrefslogtreecommitdiff
path: root/liboutput
diff options
context:
space:
mode:
Diffstat (limited to 'liboutput')
-rw-r--r--liboutput/stillimage-player.c18
-rw-r--r--liboutput/stillimage-player.h1
-rw-r--r--liboutput/stillimage.c18
-rw-r--r--liboutput/stillimage.h2
4 files changed, 8 insertions, 31 deletions
diff --git a/liboutput/stillimage-player.c b/liboutput/stillimage-player.c
index 947157e..f15ef8f 100644
--- a/liboutput/stillimage-player.c
+++ b/liboutput/stillimage-player.c
@@ -1,6 +1,6 @@
/***************************************************************************
* stillimage-player.c
- * (C) Copyright 2004 Andreas Brachold <vdr04-at-deltab.de>
+ * (C) Copyright 2004-2005 Andreas Brachold <vdr04-at-deltab.de>
* Created: Thu Aug 5 2004
*
****************************************************************************/
@@ -26,7 +26,6 @@
cStillImagePlayer::cStillImagePlayer(ePlayMode PlayMode)
: cPlayer(PlayMode)
- , m_bActive(false)
, m_StillImage(this)
{
}
@@ -36,23 +35,16 @@ cStillImagePlayer::~cStillImagePlayer()
Detach();
}
-void cStillImagePlayer::Activate(bool On) {
- if (On) {
- m_bActive=m_StillImage.Init();
+void cStillImagePlayer::Activate(bool bOn) {
+ if (bOn) {
+ m_StillImage.Start();
} else {
- if (m_bActive) {
- m_StillImage.Stop();
- m_bActive=false;
- }
+ m_StillImage.Stop();
}
}
void cStillImagePlayer::Play(const uchar *Data, int Length) {
-#if VDRVERSNUM < 10318
- PlayVideo(Data, Length);
-#else
PlayPes(Data, Length,true);
-#endif
}
bool cStillImagePlayer::Wait() {
diff --git a/liboutput/stillimage-player.h b/liboutput/stillimage-player.h
index b3aa712..c0aa632 100644
--- a/liboutput/stillimage-player.h
+++ b/liboutput/stillimage-player.h
@@ -32,7 +32,6 @@
class cStillImagePlayer
: public cPlayer {
friend class cStillImage;
- bool m_bActive;
protected:
cStillImage m_StillImage;
public:
diff --git a/liboutput/stillimage.c b/liboutput/stillimage.c
index 12bd902..a83306d 100644
--- a/liboutput/stillimage.c
+++ b/liboutput/stillimage.c
@@ -34,7 +34,6 @@
cStillImage::cStillImage(cStillImagePlayer *pl)
{
- m_bThreadRun=false;
m_bEncodeRequired = false;
player=pl;
}
@@ -44,30 +43,20 @@ cStillImage::~cStillImage()
}
-bool cStillImage::Init()
-{
- return Start();
-}
-
void cStillImage::Stop()
{
- if (!m_bThreadRun)
- return;
- m_bThreadRun=false;
-
Cancel(3);
}
void cStillImage::Action(void)
{
- m_bThreadRun=true;
bool bMPEGValid = false;
bool bQueueEmpty = false;
bool bFreeze = true;
unsigned int nFrame = 0,nFrameOff=0;
int nMircoSekWait;
- while (m_bThreadRun) {
+ while (Running()) {
nMircoSekWait = 10000;
bQueueEmpty = player->Worker(false);
@@ -89,7 +78,7 @@ void cStillImage::Action(void)
bMPEGValid = Encode();
Unlock();
- if (!m_bThreadRun)
+ if (!Running())
break;
m_bEncodeRequired = false;
nFrame = 0;
@@ -145,13 +134,12 @@ void cStillImage::Action(void)
nMircoSekWait = (1000000/(GetFrameRate()*4)); // Wait duration off 1/4 frame
- if (!m_bThreadRun)
+ if (!Running())
break;
}
//Reduce CPU load!!!
usleep(max(10000,nMircoSekWait));
}
- m_bThreadRun=false;
}
diff --git a/liboutput/stillimage.h b/liboutput/stillimage.h
index 453692c..eb6428b 100644
--- a/liboutput/stillimage.h
+++ b/liboutput/stillimage.h
@@ -35,7 +35,6 @@ class cStillImage
, public cEncode {
cStillImagePlayer *player;
- volatile bool m_bThreadRun;
volatile bool m_bEncodeRequired;
protected:
virtual void Action(void);
@@ -45,7 +44,6 @@ public:
cStillImage(cStillImagePlayer *);
virtual ~cStillImage();
- bool Init();
void Stop();
bool EncodeRequired() const {return m_bEncodeRequired;}
void EncodeRequired(bool b) {m_bEncodeRequired = b;}