1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Some fixes to the shutdown feature

This commit is contained in:
Klaus Schmidinger 2001-09-07 15:37:26 +02:00
parent fa31c70f7d
commit 3b6782a774
5 changed files with 23 additions and 11 deletions

View File

@ -715,3 +715,10 @@ Video Disk Recorder Revision History
definitions). Use your favourite text editor to delete that information. definitions). Use your favourite text editor to delete that information.
That way every recording will store the actual summary data at the time of That way every recording will store the actual summary data at the time of
the recording. 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.

2
MANUAL
View File

@ -442,7 +442,7 @@ Video Disk Recorder User's Manual
you may want to use smaller values if you are planning you may want to use smaller values if you are planning
on archiving a recording to CD. 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 MinUserInactivity=120 automatically shutdown the computer if the next timer
event is at least MinEventTimeout minutes in the future, event is at least MinEventTimeout minutes in the future,
and the user has been inactive for at least and the user has been inactive for at least

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "config.h"
@ -807,7 +807,7 @@ cSetup::cSetup(void)
OSDheight = 18; OSDheight = 18;
OSDMessageTime = 1; OSDMessageTime = 1;
MaxVideoFileSize = MAXVIDEOFILESIZE; MaxVideoFileSize = MAXVIDEOFILESIZE;
MinEventTimeout = 120; MinEventTimeout = 30;
MinUserInactivity = 120; MinUserInactivity = 120;
CurrentChannel = -1; CurrentChannel = -1;
} }

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __CONFIG_H
@ -19,7 +19,7 @@
#include "eit.h" #include "eit.h"
#include "tools.h" #include "tools.h"
#define VDRVERSION "0.94" #define VDRVERSION "0.95"
#define MaxBuffer 10000 #define MaxBuffer 10000

17
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * 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 #define _GNU_SOURCE
@ -50,6 +50,7 @@
#define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping #define ACTIVITYTIMEOUT 60 // seconds before starting housekeeping
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown #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; static int Interrupted = 0;
@ -456,15 +457,19 @@ int main(int argc, char *argv[])
cTimer *timer = Timers.GetNextActiveTimer(); cTimer *timer = Timers.GetNextActiveTimer();
time_t Next = timer ? timer->StartTime() : 0; time_t Next = timer ? timer->StartTime() : 0;
time_t Delta = timer ? Next - Now : 0; time_t Delta = timer ? Next - Now : 0;
if (timer) if (!LastActivity) {
dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); if (!timer || Delta > MANUALSTART) {
if (!Next || Delta > Setup.MinEventTimeout * 60) {
if (!LastActivity) {
// Apparently the user started VDR manually // Apparently the user started VDR manually
dsyslog(LOG_INFO, "assuming manual start of VDR"); dsyslog(LOG_INFO, "assuming manual start of VDR");
LastActivity = Now; 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) if (WatchdogTimeout > 0)
signal(SIGALRM, SIG_IGN); signal(SIGALRM, SIG_IGN);
if (Interface->Confirm(tr("Press any key to cancel shutdown"), LastActivity == 1 ? 5 : SHUTDOWNWAIT, true)) { if (Interface->Confirm(tr("Press any key to cancel shutdown"), LastActivity == 1 ? 5 : SHUTDOWNWAIT, true)) {