summaryrefslogtreecommitdiff
path: root/timers.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-03-06 11:27:08 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-03-06 11:27:08 +0100
commit18d3851b72d35b6c658dd1fb71acff1a88c2c58a (patch)
tree72cb249c33c548391c058481d4b214b269054aa7 /timers.c
parentb845ef01b56c18cab44c3992fd6cae9af2f6467a (diff)
downloadvdr-18d3851b72d35b6c658dd1fb71acff1a88c2c58a.tar.gz
vdr-18d3851b72d35b6c658dd1fb71acff1a88c2c58a.tar.bz2
Fixed assigning events to timers (they no longer get "stuck")
Diffstat (limited to 'timers.c')
-rw-r--r--timers.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/timers.c b/timers.c
index 2ec387a4..02765800 100644
--- a/timers.c
+++ b/timers.c
@@ -4,14 +4,13 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: timers.c 1.10 2004/02/29 14:20:48 kls Exp $
+ * $Id: timers.c 1.11 2004/03/06 11:22:57 kls Exp $
*/
#include "timers.h"
#include <ctype.h>
#include "channels.h"
#include "i18n.h"
-#include "libsi/si.h"
// IMPORTANT NOTE: in the 'sscanf()' calls there is a blank after the '%d'
// format characters in order to allow any number of blanks after a numeric
@@ -333,8 +332,8 @@ bool cTimer::Matches(time_t t, bool Directly)
if (HasFlags(tfActive)) {
if (HasFlags(tfVps) && !Directly && event && event->Vps()) {
startTime = event->StartTime();
- stopTime = startTime + event->Duration();
- return event->RunningStatus() > SI::RunningStatusNotRunning;
+ stopTime = event->EndTime();
+ return event->IsRunning(true);
}
return startTime <= t && t < stopTime; // must stop *before* stopTime to allow adjacent timers
}
@@ -350,9 +349,14 @@ int cTimer::Matches(const cEvent *Event)
bool m1 = Matches(t1, true);
bool m2 = UseVps ? m1 : Matches(t2, true);
startTime = stopTime = 0;
- if (m1 && m2)
+ if (m1 && m2) {
+ if (UseVps && Event->IsRunning(true))
+ return tmFull;
+ if (time(NULL) > Event->EndTime())
+ return tmNone;
return tmFull;
- if (m1 || m2)
+ }
+ if ((m1 || m2) && time(NULL) <= Event->EndTime())
return tmPartial;
}
return tmNone;
@@ -381,6 +385,8 @@ void cTimer::SetEvent(const cEvent *Event)
sprintf(vpsbuf, "(VPS: %s) ", Event->GetVpsString());
isyslog("timer %d (%d %04d-%04d '%s') set to event %s %s-%s %s'%s'", Index() + 1, Channel()->Number(), start, stop, file, Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString(), vpsbuf, Event->Title());
}
+ else
+ isyslog("timer %d (%d %04d-%04d '%s') set to no event", Index() + 1, Channel()->Number(), start, stop, file);
event = Event;
}
}