diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-17 10:52:15 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2015-01-17 10:52:15 +0100 |
commit | be92ad13ab847464be7dd712918b440da89c56e1 (patch) | |
tree | d9e8b633746ad3dac4beeec2710fa78dd2f198c2 | |
parent | 3bb447cf8d346f151a56aa7da5360db6da2db570 (diff) | |
download | vdr-be92ad13ab847464be7dd712918b440da89c56e1.tar.gz vdr-be92ad13ab847464be7dd712918b440da89c56e1.tar.bz2 |
Now returning from removing deleted recordings after at most 10 seconds, or if the user presses a remote control key
-rw-r--r-- | CONTRIBUTORS | 2 | ||||
-rw-r--r-- | HISTORY | 5 | ||||
-rw-r--r-- | recording.c | 8 |
3 files changed, 13 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 1031df50..d43f92ec 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3318,6 +3318,8 @@ Claus Muus <email@clausmuus.de> Dieter Ferdinand <dieter.ferdinand@gmx.de> for reporting a problem with jumping to an absolute position via the Red key in case replay was paused + for reporting a problem with the system getting unresponsive when removing a huge + number of files in the thread that removes deleted recordings Jasmin Jessich <jasmin@anw.at> for modifying the CAM API so that it is possible to implement CAMs that can be freely @@ -8307,7 +8307,7 @@ Video Disk Recorder Revision History - The APIVERSION has been increased to 2.0.6 due to the changes to pat.h, sdt.h and the functional modification to cFont::CreateFont(). -2015-01-15: Version 2.1.7 +2015-01-17: Version 2.1.7 - No longer logging an error message in DirSizeMB() if the given directory doesn't exist. This avoids lots of log entries in case several VDRs use the same video @@ -8381,3 +8381,6 @@ Video Disk Recorder Revision History displayed object (thanks to Thomas Reufer). - Added a comment to cRecorder::Activate() about the need to call Detach() in the destructor (suggested by Eike Sauer). +- Now returning from removing deleted recordings after at most 10 seconds, or if the + user presses a remote control key, to keep the system from getting unresponsive + when removing a huge number of files (reported by Dieter Ferdinand). diff --git a/recording.c b/recording.c index cf3c5f05..3806165e 100644 --- a/recording.c +++ b/recording.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: recording.c 3.18 2014/03/16 11:09:17 kls Exp $ + * $Id: recording.c 3.19 2015/01/17 10:49:03 kls Exp $ */ #include "recording.h" @@ -65,6 +65,7 @@ #define REMOVELATENCY 10 // seconds to wait until next check after removing a file #define MARKSUPDATEDELTA 10 // seconds between checks for updating editing marks #define MININDEXAGE 3600 // seconds before an index file is considered no longer to be written +#define MAXREMOVETIME 10 // seconds after which to return from removing deleted recordings #define MAX_LINK_LEVEL 6 @@ -97,11 +98,16 @@ void cRemoveDeletedRecordingsThread::Action(void) // Make sure only one instance of VDR does this: cLockFile LockFile(cVideoDirectory::Name()); if (LockFile.Lock()) { + time_t StartTime = time(NULL); bool deleted = false; cThreadLock DeletedRecordingsLock(&DeletedRecordings); for (cRecording *r = DeletedRecordings.First(); r; ) { if (cIoThrottle::Engaged()) return; + if (time(NULL) - StartTime > MAXREMOVETIME) + return; // don't stay here too long + if (cRemote::HasKeys()) + return; // react immediately on user input if (r->Deleted() && time(NULL) - r->Deleted() > DELETEDLIFETIME) { cRecording *next = DeletedRecordings.Next(r); r->Remove(); |