diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2009-04-13 12:29:10 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2009-04-13 12:29:10 +0200 |
commit | 7f314c07b6e89d4d1ba2c67de35183180876e501 (patch) | |
tree | 61ae8e681a6f10b88650ba1c66a8cb0b4a1d16bd /recording.c | |
parent | 27c061e449729f586d07c961e43691d2bc3105cb (diff) | |
download | vdr-7f314c07b6e89d4d1ba2c67de35183180876e501.tar.gz vdr-7f314c07b6e89d4d1ba2c67de35183180876e501.tar.bz2 |
Reverted back to previous version of RemoveDeletedRecordings(), because the thread was started every minute
Diffstat (limited to 'recording.c')
-rw-r--r-- | recording.c | 13 |
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); } } |