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

Fixed handling repeating VPS timers (they stopped recording too early)

This commit is contained in:
Klaus Schmidinger 2006-03-25 11:39:57 +01:00
parent 7bba79ef0a
commit c55be788f3
2 changed files with 14 additions and 8 deletions

View File

@ -4415,7 +4415,7 @@ Video Disk Recorder Revision History
- Fixed cSchedule::GetFollowingEvent() in case there is currently no present event - Fixed cSchedule::GetFollowingEvent() in case there is currently no present event
running (thanks to Pekka Mauno). running (thanks to Pekka Mauno).
2006-03-19: Version 1.3.45 2006-03-25: Version 1.3.45
- Fixed updating the "Info" button in the "Timers" menu. - Fixed updating the "Info" button in the "Timers" menu.
- Reduced the number of events to actually check when setting events to timers. - Reduced the number of events to actually check when setting events to timers.
@ -4434,3 +4434,4 @@ Video Disk Recorder Revision History
deleted (reported by Hardy Flor). deleted (reported by Hardy Flor).
- Fixed deleting recordings that have been removed externally when running out of - Fixed deleting recordings that have been removed externally when running out of
disk space (reported by Jan Lenz). disk space (reported by Jan Lenz).
- Fixed handling repeating VPS timers (they stopped recording too early).

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: timers.c 1.51 2006/02/28 12:40:33 kls Exp $ * $Id: timers.c 1.52 2006/03/25 11:39:50 kls Exp $
*/ */
#include "timers.h" #include "timers.h"
@ -446,15 +446,20 @@ void cTimer::SetEventFromSchedule(const cSchedules *Schedules)
const cEvent *Event = NULL; const cEvent *Event = NULL;
int Overlap = 0; int Overlap = 0;
int Distance = INT_MIN; int Distance = INT_MIN;
bool UseVps = HasFlags(tfVps);
const cEvent *PresentEvent = UseVps ? Schedule->GetPresentEvent() : NULL;
const cEvent *FollowingEvent = UseVps ? Schedule->GetFollowingEvent() : NULL;
// Set up the time frame within which to check events: // Set up the time frame within which to check events:
Matches(0, true); Matches(0, true);
time_t TimeFrameBegin = StartTime() - (HasFlags(tfVps) ? VPSLIMITBEFORE : EPGLIMITBEFORE); time_t TimeFrameBegin = StartTime() - (UseVps ? VPSLIMITBEFORE : EPGLIMITBEFORE);
time_t TimeFrameEnd = StopTime() + (HasFlags(tfVps) ? VPSLIMITAFTER : EPGLIMITAFTER); time_t TimeFrameEnd = StopTime() + (UseVps ? VPSLIMITAFTER : EPGLIMITAFTER);
for (const cEvent *e = Schedule->Events()->First(); e; e = Schedule->Events()->Next(e)) { for (const cEvent *e = Schedule->Events()->First(); e; e = Schedule->Events()->Next(e)) {
if (!UseVps || e != event && e != PresentEvent && e != FollowingEvent) { // always check these if this is a VPS timer
if (e->EndTime() < TimeFrameBegin) if (e->EndTime() < TimeFrameBegin)
continue; // skip events way before the timer starts continue; // skip events way before the timer starts
if (e->StartTime() > TimeFrameEnd) if (e->StartTime() > TimeFrameEnd)
break; // the rest is way after the timer ends break; // the rest is way after the timer ends
}
int overlap = 0; int overlap = 0;
Matches(e, &overlap); Matches(e, &overlap);
if (overlap && overlap >= Overlap) { if (overlap && overlap >= Overlap) {