summaryrefslogtreecommitdiff
path: root/server/suspend.c
diff options
context:
space:
mode:
authorFrank Schmirler <vdr@schmirler.de>2010-12-02 09:43:13 +0100
committerFrank Schmirler <vdr@schmirler.de>2010-12-02 09:43:13 +0100
commit7254a6752808830d5fc133e5362da6c47f3f84ff (patch)
tree673cc17f88ba80f8a67debb54f85ea100cde9ae5 /server/suspend.c
parent31df0eaf8e49bc1cfea755bd88f3dd795c8f1ace (diff)
downloadvdr-plugin-streamdev-7254a6752808830d5fc133e5362da6c47f3f84ff.tar.gz
vdr-plugin-streamdev-7254a6752808830d5fc133e5362da6c47f3f84ff.tar.bz2
Snapshot 2009-06-11
Diffstat (limited to 'server/suspend.c')
-rw-r--r--server/suspend.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/server/suspend.c b/server/suspend.c
index 9ac9ac5..b6e1382 100644
--- a/server/suspend.c
+++ b/server/suspend.c
@@ -1,5 +1,5 @@
/*
- * $Id: suspend.c,v 1.1.1.1 2004/12/30 22:44:21 lordjaxom Exp $
+ * $Id: suspend.c,v 1.3 2008/10/22 11:59:32 schmirl Exp $
*/
#include "server/suspend.h"
@@ -7,13 +7,12 @@
#include "common.h"
cSuspendLive::cSuspendLive(void)
-#if VDRVERSNUM >= 10300
: cThread("Streamdev: server suspend")
-#endif
{
}
cSuspendLive::~cSuspendLive() {
+ Stop();
Detach();
}
@@ -26,26 +25,15 @@ void cSuspendLive::Activate(bool On) {
}
void cSuspendLive::Stop(void) {
- if (m_Active) {
- m_Active = false;
+ if (Running())
Cancel(3);
- }
}
void cSuspendLive::Action(void) {
-#if VDRVERSNUM < 10300
- isyslog("Streamdev: Suspend Live thread started (pid = %d)", getpid());
-#endif
-
- m_Active = true;
- while (m_Active) {
+ while (Running()) {
DeviceStillPicture(suspend_mpg, sizeof(suspend_mpg));
- usleep(100000);
+ cCondWait::SleepMs(100);
}
-
-#if VDRVERSNUM < 10300
- isyslog("Streamdev: Suspend Live thread stopped");
-#endif
}
bool cSuspendCtl::m_Active = false;
@@ -61,7 +49,7 @@ cSuspendCtl::~cSuspendCtl() {
}
eOSState cSuspendCtl::ProcessKey(eKeys Key) {
- if (!m_Suspend->IsActive() || Key == kBack) {
+ if (!m_Suspend->Active() || Key == kBack) {
DELETENULL(m_Suspend);
return osEnd;
}