1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed removing recordings with Lifetime = 99

This commit is contained in:
Klaus Schmidinger 2001-06-12 15:32:47 +02:00
parent 47c5bd66a8
commit f585f21583
2 changed files with 11 additions and 11 deletions

View File

@ -500,4 +500,4 @@ Video Disk Recorder Revision History
"Green" button in the "Main" menu. The "Edit Channel" menu therefore now "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 has two audio PID fields (Apid1 and Apid2). By default, Apid2 is 0, which
means there is no alternate audio track. means there is no alternate audio track.
- Fixed removing recordings with Lifetime = 99.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #define _GNU_SOURCE
@ -94,16 +94,16 @@ void AssertFreeDiskSpace(int Priority)
cRecording *r = Recordings.First(); cRecording *r = Recordings.First();
cRecording *r0 = NULL; cRecording *r0 = NULL;
while (r) { while (r) {
if (r->lifetime == MAXLIFETIME) if (r->lifetime < MAXLIFETIME) { // recordings with MAXLIFETIME live forever
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
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
(time(NULL) - r->start) / SECSINDAY > r->lifetime) { // the recording's guaranteed lifetime has expired if (r0) {
if (r0) { if (r->priority < r0->priority || (r->priority == r0->priority && r->start < r0->start))
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)
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); r = Recordings.Next(r);
} }