summaryrefslogtreecommitdiff
path: root/recording.c
diff options
context:
space:
mode:
Diffstat (limited to 'recording.c')
-rw-r--r--recording.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/recording.c b/recording.c
index 22df5b6c..00965a7d 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.10 2009/04/12 14:04:22 kls Exp $
+ * $Id: recording.c 2.11 2009/04/13 12:28:36 kls Exp $
*/
#include "recording.h"
@@ -114,8 +114,15 @@ void RemoveDeletedRecordings(void)
{
static time_t LastRemoveCheck = 0;
if (time(NULL) - LastRemoveCheck > REMOVECHECKDELTA) {
- if (!RemoveDeletedRecordingsThread.Active())
- RemoveDeletedRecordingsThread.Start();
+ if (!RemoveDeletedRecordingsThread.Active()) {
+ cThreadLock DeletedRecordingsLock(&DeletedRecordings);
+ for (cRecording *r = DeletedRecordings.First(); r; r = DeletedRecordings.Next(r)) {
+ if (r->deleted && time(NULL) - r->deleted > DELETEDLIFETIME) {
+ RemoveDeletedRecordingsThread.Start();
+ break;
+ }
+ }
+ }
LastRemoveCheck = time(NULL);
}
}