mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed handling VPS timers, so that they only record if the event they are assigned to actually has the given VPS time
This commit is contained in:
parent
7e81649d68
commit
be1b6b5e88
2
HISTORY
2
HISTORY
@ -3622,3 +3622,5 @@ Video Disk Recorder Revision History
|
|||||||
in menu lists (based on a suggestion by Patrick Gleichmann).
|
in menu lists (based on a suggestion by Patrick Gleichmann).
|
||||||
- Removed the NPTL check at startup, since several users have reported that VDR
|
- Removed the NPTL check at startup, since several users have reported that VDR
|
||||||
now runs fine with NPTL.
|
now runs fine with NPTL.
|
||||||
|
- Fixed handling VPS timers, so that they only record if the event they are assigned
|
||||||
|
to actually has the given VPS time.
|
||||||
|
20
timers.c
20
timers.c
@ -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.32 2005/06/11 14:19:58 kls Exp $
|
* $Id: timers.c 1.33 2005/06/18 12:49:55 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
@ -363,6 +363,8 @@ bool cTimer::Matches(time_t t, bool Directly) const
|
|||||||
|
|
||||||
if (HasFlags(tfActive)) {
|
if (HasFlags(tfActive)) {
|
||||||
if (HasFlags(tfVps) && !Directly && event && event->Vps() && schedule && schedule->PresentSeenWithin(30)) {
|
if (HasFlags(tfVps) && !Directly && event && event->Vps() && schedule && schedule->PresentSeenWithin(30)) {
|
||||||
|
if (startTime != event->Vps())
|
||||||
|
return false;
|
||||||
startTime = event->StartTime();
|
startTime = event->StartTime();
|
||||||
stopTime = event->EndTime();
|
stopTime = event->EndTime();
|
||||||
return event->IsRunning(true);
|
return event->IsRunning(true);
|
||||||
@ -384,15 +386,17 @@ int cTimer::Matches(const cEvent *Event, int *Overlap) const
|
|||||||
if (HasFlags(tfActive) && channel->GetChannelID() == Event->ChannelID()) {
|
if (HasFlags(tfActive) && channel->GetChannelID() == Event->ChannelID()) {
|
||||||
bool UseVps = HasFlags(tfVps) && Event->Vps();
|
bool UseVps = HasFlags(tfVps) && Event->Vps();
|
||||||
Matches(UseVps ? Event->Vps() : Event->StartTime(), true);
|
Matches(UseVps ? Event->Vps() : Event->StartTime(), true);
|
||||||
int overlap;
|
int overlap = 0;
|
||||||
if (UseVps)
|
if (UseVps)
|
||||||
overlap = (startTime == Event->Vps()) ? FULLMATCH + (Event->IsRunning() ? 200 : 100) : 0;
|
overlap = (startTime == Event->Vps()) ? FULLMATCH + (Event->IsRunning() ? 200 : 100) : 0;
|
||||||
else if (startTime <= Event->StartTime() && Event->EndTime() <= stopTime)
|
if (!overlap) {
|
||||||
overlap = FULLMATCH;
|
if (startTime <= Event->StartTime() && Event->EndTime() <= stopTime)
|
||||||
else if (stopTime <= Event->StartTime() || Event->EndTime() <= startTime)
|
overlap = FULLMATCH;
|
||||||
overlap = 0;
|
else if (stopTime <= Event->StartTime() || Event->EndTime() <= startTime)
|
||||||
else
|
overlap = 0;
|
||||||
overlap = (min(stopTime, Event->EndTime()) - max(startTime, Event->StartTime())) * FULLMATCH / max(Event->Duration(), 1);
|
else
|
||||||
|
overlap = (min(stopTime, Event->EndTime()) - max(startTime, Event->StartTime())) * FULLMATCH / max(Event->Duration(), 1);
|
||||||
|
}
|
||||||
startTime = stopTime = 0;
|
startTime = stopTime = 0;
|
||||||
if (Overlap)
|
if (Overlap)
|
||||||
*Overlap = overlap;
|
*Overlap = overlap;
|
||||||
|
Loading…
Reference in New Issue
Block a user