From 3b6782a774510608efcca20bdd703c83151e85e8 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 7 Sep 2001 15:37:26 +0200 Subject: [PATCH] Some fixes to the shutdown feature --- HISTORY | 7 +++++++ MANUAL | 2 +- config.c | 4 ++-- config.h | 4 ++-- vdr.c | 17 +++++++++++------ 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/HISTORY b/HISTORY index d2be0544..d0df9ae6 100644 --- a/HISTORY +++ b/HISTORY @@ -715,3 +715,10 @@ Video Disk Recorder Revision History definitions). Use your favourite text editor to delete that information. That way every recording will store the actual summary data at the time of the recording. + +2001-09-03: Version 0.95 + +- Fixed behaviour in case the shutdown didn't take place (there were many + "next timer event at..." messages in that case). +- Reduced the default value for MinEventTimeout to 30 minutes. +- Fixed detecting manual start in shutdown feature. diff --git a/MANUAL b/MANUAL index c6b5efd7..ab1d9b3a 100644 --- a/MANUAL +++ b/MANUAL @@ -442,7 +442,7 @@ Video Disk Recorder User's Manual you may want to use smaller values if you are planning on archiving a recording to CD. - MinEventTimeout=120 If the command line option '-s' has been set, VDR will + MinEventTimeout=30 If the command line option '-s' has been set, VDR will MinUserInactivity=120 automatically shutdown the computer if the next timer event is at least MinEventTimeout minutes in the future, and the user has been inactive for at least diff --git a/config.c b/config.c index a97d7e4c..1555f604 100644 --- a/config.c +++ b/config.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.c 1.64 2001/09/02 15:04:13 kls Exp $ + * $Id: config.c 1.65 2001/09/03 16:01:46 kls Exp $ */ #include "config.h" @@ -807,7 +807,7 @@ cSetup::cSetup(void) OSDheight = 18; OSDMessageTime = 1; MaxVideoFileSize = MAXVIDEOFILESIZE; - MinEventTimeout = 120; + MinEventTimeout = 30; MinUserInactivity = 120; CurrentChannel = -1; } diff --git a/config.h b/config.h index c3fab9a8..8e0d65f3 100644 --- a/config.h +++ b/config.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: config.h 1.72 2001/09/02 15:45:17 kls Exp $ + * $Id: config.h 1.73 2001/09/03 15:31:06 kls Exp $ */ #ifndef __CONFIG_H @@ -19,7 +19,7 @@ #include "eit.h" #include "tools.h" -#define VDRVERSION "0.94" +#define VDRVERSION "0.95" #define MaxBuffer 10000 diff --git a/vdr.c b/vdr.c index efb5e1c3..a41fa5d0 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.68 2001/09/01 14:50:40 kls Exp $ + * $Id: vdr.c 1.69 2001/09/07 15:37:26 kls Exp $ */ #define _GNU_SOURCE @@ -50,6 +50,7 @@ #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 static int Interrupted = 0; @@ -456,15 +457,19 @@ int main(int argc, char *argv[]) cTimer *timer = Timers.GetNextActiveTimer(); time_t Next = timer ? timer->StartTime() : 0; time_t Delta = timer ? Next - Now : 0; - if (timer) - dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); - if (!Next || Delta > Setup.MinEventTimeout * 60) { - if (!LastActivity) { + if (!LastActivity) { + if (!timer || Delta > MANUALSTART) { // Apparently the user started VDR manually dsyslog(LOG_INFO, "assuming manual start of VDR"); LastActivity = Now; - continue; // skip the rest of the housekeeping for now + continue; // don't run into the actual shutdown procedure below } + else + LastActivity = 1; + } + if (!Next || Delta > Setup.MinEventTimeout * 60) { + if (timer) + dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); if (WatchdogTimeout > 0) signal(SIGALRM, SIG_IGN); if (Interface->Confirm(tr("Press any key to cancel shutdown"), LastActivity == 1 ? 5 : SHUTDOWNWAIT, true)) {