diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 173f2646..4b9b5894 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -2589,6 +2589,7 @@ Markus Ehrnsperger systems where 'int' is 64 bit for suggesting a fix for expiring of one-time VPS timers in case there is more than one event with the same VPS time + for fixing handling margins for timers that are not VPS controlled and not spawned Werner Färber for reporting a bug in handling the cPluginManager::Active() result when pressing diff --git a/HISTORY b/HISTORY index c47a51b1..5aa5bda9 100644 --- a/HISTORY +++ b/HISTORY @@ -10050,3 +10050,5 @@ Video Disk Recorder Revision History - Fixed a possible deadlock when canceling an editing process. - Checking for VPS control is now limited to local timers. - Added 1 to Utf8BufSize() for worst case (thanks to Stefan Hofmann). +- Fixed handling margins for timers that are not VPS controlled and not spawned (thanks + to Markus Ehrnsperger). diff --git a/timers.c b/timers.c index 7854941e..122a9473 100644 --- a/timers.c +++ b/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 5.24 2025/01/13 12:34:18 kls Exp $ + * $Id: timers.c 5.25 2025/01/13 14:44:18 kls Exp $ */ #include "timers.h" @@ -185,6 +185,8 @@ cTimer::cTimer(const cEvent *Event, const char *FileName, const cTimer *PatternT deferred = 0; pending = inVpsMargin = false; flags = tfActive; + if (PatternTimer) + SetFlags(tfSpawned); *pattern = 0; *file = 0; aux = NULL; @@ -284,10 +286,12 @@ void cTimer::CalcMargins(int &MarginStart, int &MarginStop, const cEvent *Event) MarginStop = Setup.MarginStop * 60; // To make sure the timer gets assigned to the correct event, we must // make sure that this is the only event that overlaps 100%: - if (const cEvent *e = dynamic_cast(Event->Prev())) - MarginStart = max(0, min(MarginStart, e->Duration() - 60)); - if (const cEvent *e = dynamic_cast(Event->Next())) - MarginStop = max(0, min(MarginStop, e->Duration() - 60)); + if (HasFlags(tfSpawned)) { + if (const cEvent *e = dynamic_cast(Event->Prev())) + MarginStart = max(0, min(MarginStart, e->Duration() - 60)); + if (const cEvent *e = dynamic_cast(Event->Next())) + MarginStop = max(0, min(MarginStop, e->Duration() - 60)); + } } int cTimer::Compare(const cListObject &ListObject) const @@ -813,7 +817,6 @@ cTimer *cTimer::SpawnPatternTimer(const cEvent *Event, cTimers *Timers) cString FileName = MakePatternFileName(Pattern(), Event->Title(), Event->ShortText(), File()); isyslog("spawning timer %s for event %s", *ToDescr(), *Event->ToDescr()); cTimer *t = new cTimer(Event, FileName, this); - t->SetFlags(tfSpawned); if (startswith(Pattern(), TIMERPATTERN_AVOID)) t->SetFlags(tfAvoid); Timers->Add(t);