From f585f21583e3c72a24a47682be0ebdb70056be96 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 12 Jun 2001 15:32:47 +0200 Subject: [PATCH] Fixed removing recordings with Lifetime = 99 --- HISTORY | 2 +- recording.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/HISTORY b/HISTORY index 07d12404..ac7121cc 100644 --- a/HISTORY +++ b/HISTORY @@ -500,4 +500,4 @@ Video Disk Recorder Revision History "Green" button in the "Main" menu. The "Edit Channel" menu therefore now has two audio PID fields (Apid1 and Apid2). By default, Apid2 is 0, which means there is no alternate audio track. - +- Fixed removing recordings with Lifetime = 99. diff --git a/recording.c b/recording.c index 2802c5b0..6b35ef29 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.30 2001/06/02 10:07:01 kls Exp $ + * $Id: recording.c 1.31 2001/06/12 15:31:32 kls Exp $ */ #define _GNU_SOURCE @@ -94,16 +94,16 @@ void AssertFreeDiskSpace(int Priority) cRecording *r = Recordings.First(); cRecording *r0 = NULL; while (r) { - if (r->lifetime == MAXLIFETIME) - continue; // recordings with MAXLIFETIME live forever - if ((r->lifetime == 0 && Priority > r->priority) || // the recording has guaranteed lifetime and the new recording has higher priority - (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) + if (r->lifetime < MAXLIFETIME) { // recordings with MAXLIFETIME live forever + if ((r->lifetime == 0 && Priority > r->priority) || // the recording has guaranteed lifetime and the new recording has higher priority + (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) + } + else + r0 = r; } - else - r0 = r; } r = Recordings.Next(r); }