Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Power off with 1.1.19?



Gregoire Favre wrote:
> 
> On Fri, Dec 13, 2002 at 04:25:59PM +0100, Klaus Schmidinger wrote:
> 
> > Do you mean the one I posted last monday? That was only a quick hack
> 
> Yes ;-)
> 
> > to get back to the original behaviour, but it actually removed the intended
> > check that kept the shutdown from happening while an SVDRP conenction was
> > active. What I posted today should make the shutdown use the correct timeout,
> > even if it was initiated through an SVDRP connection. The actual shutdown,
> > however, will happen only after the SVDRP connection has been closed.
> 
> I don't want such a "feature": I have xawtv which keep the connection
> open all the time, and I use it to send the power down order!!!

Ok, I've modified the change so that it will shutdown in case the Power key
has been pressed (either directly or via a HITK command), even if an SVDRP
connection is still active.

Here's the diff again, in case you'd like to give it a try:

--- vdr.c       2002/12/13 13:37:28     1.138
+++ vdr.c       2002/12/13 15:54:17
@@ -424,6 +424,7 @@
   time_t LastActivity = 0;
   int MaxLatencyTime = 0;
   bool ForceShutdown = false;
+  bool UserShutdown = false;

   if (WatchdogTimeout > 0) {
      dsyslog("setting watchdog timer to %d seconds", WatchdogTimeout);
@@ -539,6 +540,7 @@
                              ForceShutdown = true;
                           }
                        LastActivity = 1; // not 0, see below!
+                       UserShutdown = true;
                        break;
           default: break;
           }
@@ -647,7 +649,7 @@
                  Interface->Info(tr("Editing process finished"));
               }
            }
-        if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection()) || ForceShutdown)) {
+        if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && (!Interface->HasSVDRPConnection() || UserShutdown)) || ForceShutdown)) {
            time_t Now = time(NULL);
            if (Now - LastActivity > ACTIVITYTIMEOUT) {
               // Shutdown:
@@ -665,12 +667,13 @@
                     else
                        LastActivity = 1;
                     }
-                 bool UserShutdown = key == kPower;
                  if (UserShutdown && Next && Delta <= Setup.MinEventTimeout * 60 && !ForceShutdown) {
                     char *buf;
                     asprintf(&buf, tr("Recording in %d minutes, shut down anyway?"), Delta / 60);
                     if (Interface->Confirm(buf))
                        ForceShutdown = true;
+                    else
+                       UserShutdown = false;
                     free(buf);
                     }
                  if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
@@ -694,6 +697,7 @@
                           signal(SIGALRM, SIG_IGN);
                        }
                     LastActivity = time(NULL); // don't try again too soon
+                    UserShutdown = false;
                     continue; // skip the rest of the housekeeping for now
                     }
                  }


Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index