summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-05-06 14:00:45 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2005-05-06 14:00:45 +0200
commit6ca56047ae0f8078629b12f5e7408b0c57b9fec6 (patch)
tree8f2bb77381f3bdb1d6135234141931aea95987dc
parentb3c1f1bb7362825f0bb08dbae11b28d2d74649ae (diff)
downloadvdr-6ca56047ae0f8078629b12f5e7408b0c57b9fec6.tar.gz
vdr-6ca56047ae0f8078629b12f5e7408b0c57b9fec6.tar.bz2
Fixed handling lifetime when deciding whether to delete a recording
-rw-r--r--CONTRIBUTORS1
-rw-r--r--HISTORY2
-rw-r--r--recording.c4
3 files changed, 5 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 5b3c7239..5e02cc37 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1207,6 +1207,7 @@ Milos Kapoun <m.kapoun@cra.cz>
Udo Richter <udo_richter@gmx.de>
for refining the formula for making volume control more linear
+ for fixing handling lifetime when deciding whether to delete a recording
Sven Kreiensen <svenk@kammer.uni-hannover.de>
for his help in keeping 'channels.conf.terr' up to date
diff --git a/HISTORY b/HISTORY
index da4473c6..71c9bd1d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3494,3 +3494,5 @@ Video Disk Recorder Revision History
- When reading the channels.conf file, duplicate channels (i.e. ones that have
the same channel ID) are now automatically deleted and only the first one is
actually stored.
+- Fixed handling lifetime when deciding whether to delete a recording (thanks to
+ Udo Richter).
diff --git a/recording.c b/recording.c
index e50dfcb7..dde2ee38 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 1.96 2005/02/12 10:17:47 kls Exp $
+ * $Id: recording.c 1.97 2005/05/06 14:00:23 kls Exp $
*/
#include "recording.h"
@@ -126,7 +126,7 @@ void AssertFreeDiskSpace(int Priority)
while (r) {
if (!r->IsEdited() && r->lifetime < MAXLIFETIME) { // edited recordings and recordings with MAXLIFETIME live forever
if ((r->lifetime == 0 && Priority > r->priority) || // the recording has no guaranteed lifetime and the new recording has higher priority
- (time(NULL) - r->start) / SECSINDAY > r->lifetime) { // the recording's guaranteed lifetime has expired
+ (r->lifetime > 0 && (time(NULL) - r->start) / SECSINDAY >= r->lifetime)) { // the recording's guaranteed lifetime has expired
if (r0) {
if (r->priority < r0->priority || (r->priority == r0->priority && r->start < r0->start))
r0 = r; // in any case we delete the one with the lowest priority (or the older one in case of equal priorities)