summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2003-05-03 13:42:37 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2003-05-03 13:42:37 +0200
commit3fc00d2211c732b2b9ecdead946bb9d3a0d9c621 (patch)
tree25895faeeaaf0b6736d69ee4c05f02110a888329 /vdr.c
parent201364cd8a874a9496212509877a72a7a53c5367 (diff)
downloadvdr-3fc00d2211c732b2b9ecdead946bb9d3a0d9c621.tar.gz
vdr-3fc00d2211c732b2b9ecdead946bb9d3a0d9c621.tar.bz2
Restoring the current channel in case a recording has switched the transponder
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/vdr.c b/vdr.c
index ca16433e..ae4edd56 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.151 2003/05/02 10:59:07 kls Exp $
+ * $Id: vdr.c 1.152 2003/05/03 13:39:57 kls Exp $
*/
#include <getopt.h>
@@ -53,6 +53,7 @@
#include "tools.h"
#include "videodir.h"
+#define MINCHANNELWAIT 10 // seconds to wait between failed channel switchings
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown
#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start
@@ -460,9 +461,14 @@ int main(int argc, char *argv[])
}
// Attach launched player control:
cControl::Attach();
- // Make sure Transfer-Mode is re-started after detaching a player:
- if (cDevice::PrimaryDevice()->PlayerDetached() && !cDevice::PrimaryDevice()->Replaying())
- Channels.SwitchTo(cDevice::CurrentChannel());
+ // Make sure we have a visible programme in case device usage has changed:
+ if (!cDevice::PrimaryDevice()->HasProgramme()) {
+ static time_t lastTime = 0;
+ if (time(NULL) - lastTime > MINCHANNELWAIT) {
+ if (!Channels.SwitchTo(cDevice::CurrentChannel()))
+ lastTime = time(NULL); // don't do this too often
+ }
+ }
// Restart the Watchdog timer:
if (WatchdogTimeout > 0) {
int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout);