summaryrefslogtreecommitdiff
path: root/softhddevice.cpp
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2012-01-11 18:01:18 +0100
committerJohns <johns98@gmx.net>2012-01-11 18:01:18 +0100
commitd983f780b326ad97b6c882900d479edee8c0db29 (patch)
tree9da9e55d04349db8e5feb9ff3760a6cc267249b8 /softhddevice.cpp
parent712b2e0de1cf9b0ff3706ce44c079e748399c0d4 (diff)
downloadvdr-plugin-softhddevice-d983f780b326ad97b6c882900d479edee8c0db29.tar.gz
vdr-plugin-softhddevice-d983f780b326ad97b6c882900d479edee8c0db29.tar.bz2
Suspend when user is inactive.
Diffstat (limited to 'softhddevice.cpp')
-rw-r--r--softhddevice.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/softhddevice.cpp b/softhddevice.cpp
index 7d40b61..d34daea 100644
--- a/softhddevice.cpp
+++ b/softhddevice.cpp
@@ -547,7 +547,7 @@ bool cSoftHdDevice::SetPlayMode(ePlayMode PlayMode)
case pmVideoOnly:
break;
case pmNone:
- break;
+ return true;
case pmExtern_THIS_SHOULD_BE_AVOIDED:
break;
default:
@@ -830,15 +830,14 @@ bool cPluginSoftHdDevice::Initialize(void)
return true;
}
+/**
+** Start any background activities the plugin shall perform.
+*/
bool cPluginSoftHdDevice::Start(void)
{
- const cDevice *primary;
-
- // Start any background activities the plugin shall perform.
//dsyslog("[softhddev]%s:\n", __FUNCTION__);
- primary = cDevice::PrimaryDevice();
- if (MyDevice != primary) {
+ if (!MyDevice->IsPrimaryDevice()) {
isyslog("[softhddev] softhddevice is not the primary device!");
if (ConfigMakePrimary) {
// Must be done in the main thread
@@ -889,6 +888,8 @@ cOsdObject *cPluginSoftHdDevice::MainMenuAction(void)
{
dsyslog("[softhddev]%s:\n", __FUNCTION__);
+ //cDevice::PrimaryDevice()->StopReplay();
+ ShutdownHandler.SetUserInactive();
Suspend();
return NULL;
@@ -908,6 +909,12 @@ void cPluginSoftHdDevice::MainThreadHook(void)
DoMakePrimary = 0;
}
+ // check if user is inactive, automatic enter suspend mode
+ if (ShutdownHandler.IsUserInactive()) {
+ // this is regular called, but guarded against double calls
+ Suspend();
+ }
+
::MainThreadHook();
}