summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2015-01-17 10:55:42 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2015-01-17 10:55:42 +0100
commit1c9cd049b4c3d6e8989b3f3c0312f90f788106c5 (patch)
treebc487386f1cea3030e24766b49a71042fc9c41b4
parentff2f39b440b0f0c2f2bb64ec17583b8c44c51ff9 (diff)
downloadvdr-1c9cd049b4c3d6e8989b3f3c0312f90f788106c5.tar.gz
vdr-1c9cd049b4c3d6e8989b3f3c0312f90f788106c5.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--CONTRIBUTORS2
-rw-r--r--HISTORY5
-rw-r--r--recording.c8
3 files changed, 13 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 78afe620..20806dfb 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3219,3 +3219,5 @@ Christian Winkler <winkler_chr@yahoo.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
diff --git a/HISTORY b/HISTORY
index 41528608..90fddfdb 100644
--- a/HISTORY
+++ b/HISTORY
@@ -7916,10 +7916,13 @@ 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-13: Version 2.0.7
+2015-01-17: Version 2.0.7
- Fixed a possible division by zero in frame rate detection.
- Fixed a bug in the Makefile when installing plugins with LCLBLD=1 (thanks to
Stefan Huelswitt).
- Fixed jumping to an absolute position via the Red key in case replay was paused
(reported by Dieter Ferdinand).
+- 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 d62dd9c8..460a1107 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 2.91.1.7 2014/03/16 11:03:18 kls Exp $
+ * $Id: recording.c 2.91.1.8 2015/01/17 10:54:16 kls Exp $
*/
#include "recording.h"
@@ -63,6 +63,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
@@ -93,11 +94,16 @@ void cRemoveDeletedRecordingsThread::Action(void)
// Make sure only one instance of VDR does this:
cLockFile LockFile(VideoDirectory);
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();