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:
parent
7bba79ef0a
commit
c55be788f3
3
HISTORY
3
HISTORY
@ -4415,7 +4415,7 @@ Video Disk Recorder Revision History
|
||||
- Fixed cSchedule::GetFollowingEvent() in case there is currently no present event
|
||||
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.
|
||||
- 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).
|
||||
- Fixed deleting recordings that have been removed externally when running out of
|
||||
disk space (reported by Jan Lenz).
|
||||
- Fixed handling repeating VPS timers (they stopped recording too early).
|
||||
|
19
timers.c
19
timers.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* 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"
|
||||
@ -446,15 +446,20 @@ void cTimer::SetEventFromSchedule(const cSchedules *Schedules)
|
||||
const cEvent *Event = NULL;
|
||||
int Overlap = 0;
|
||||
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:
|
||||
Matches(0, true);
|
||||
time_t TimeFrameBegin = StartTime() - (HasFlags(tfVps) ? VPSLIMITBEFORE : EPGLIMITBEFORE);
|
||||
time_t TimeFrameEnd = StopTime() + (HasFlags(tfVps) ? VPSLIMITAFTER : EPGLIMITAFTER);
|
||||
time_t TimeFrameBegin = StartTime() - (UseVps ? VPSLIMITBEFORE : EPGLIMITBEFORE);
|
||||
time_t TimeFrameEnd = StopTime() + (UseVps ? VPSLIMITAFTER : EPGLIMITAFTER);
|
||||
for (const cEvent *e = Schedule->Events()->First(); e; e = Schedule->Events()->Next(e)) {
|
||||
if (e->EndTime() < TimeFrameBegin)
|
||||
continue; // skip events way before the timer starts
|
||||
if (e->StartTime() > TimeFrameEnd)
|
||||
break; // the rest is way after the timer ends
|
||||
if (!UseVps || e != event && e != PresentEvent && e != FollowingEvent) { // always check these if this is a VPS timer
|
||||
if (e->EndTime() < TimeFrameBegin)
|
||||
continue; // skip events way before the timer starts
|
||||
if (e->StartTime() > TimeFrameEnd)
|
||||
break; // the rest is way after the timer ends
|
||||
}
|
||||
int overlap = 0;
|
||||
Matches(e, &overlap);
|
||||
if (overlap && overlap >= Overlap) {
|
||||
|
Loading…
Reference in New Issue
Block a user