Udo Richter wrote:
Klaus Schmidinger wrote:
Are you sure?
ACTIVITYTIMEOUT is 60 seconds, so wouldn't your change just
avoid the calls until 60 seconds after the last user activity?


Hmm, you're right. Its not a test on Setup.MinUserInactivity * 60. My patch would just avoid these calls the usual 60 seconds after a key press.

However, I still think that Active() should be called only if VDR is really willing to shut down, and not while running normally. Or is Active() supposed to also delay any housekeeping tasks?

Since cPlugin::Active() is only intended to be a means of preventing
VDR from shutting down, I'd say you're right - it should only be called
when VDR is actually trying to shut down.

The attached patch makes it call cPluginManager::Active() only
if it really wants to shut down, and if there is actually an option
for plugins to delay the shutdown (i.e. this is not a forced shutdown).

If cPluginManager::Active() returns 'true' once, it waits for SHUTDOWNRETRY
minutes before trying again.

Please give this a try and let me know whether it works.

Klaus
--- vdr.c	2006/10/14 10:01:32	1.280
+++ vdr.c	2006/12/02 10:20:30
@@ -1154,11 +1154,15 @@
                  Skins.Message(mtInfo, tr("Editing process finished"));
               }
            }
-        if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && !cPluginManager::Active() && (!Interface->HasSVDRPConnection() || UserShutdown)) || ForceShutdown)) {
+        if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && (!Interface->HasSVDRPConnection() || UserShutdown)) || ForceShutdown)) {
            time_t Now = time(NULL);
            if (Now - LastActivity > ACTIVITYTIMEOUT) {
               // Shutdown:
               if (Shutdown && (Setup.MinUserInactivity || LastActivity == 1) && Now - LastActivity > Setup.MinUserInactivity * 60) {
+                 if (!ForceShutdown && cPluginManager::Active()) {
+                    LastActivity = time(NULL) - Setup.MinUserInactivity * 60 + SHUTDOWNRETRY; // try again later
+                    continue;
+                    }
                  cTimer *timer = Timers.GetNextActiveTimer();
                  time_t Next  = timer ? timer->StartTime() : 0;
                  time_t Delta = timer ? Next - Now : 0;
_______________________________________________
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

Reply via email to