summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2006-01-29 14:04:37 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2006-01-29 14:04:37 +0100
commitea9a7eebd1397b2fef02b660f33970944a4bb832 (patch)
tree5b0712b5fc9d526627033551abf33d7ba78ad6c6 /epg.c
parent778a6b47ca84ba3f8357fb7ac9daa120eeb12d3b (diff)
downloadvdr-ea9a7eebd1397b2fef02b660f33970944a4bb832.tar.gz
vdr-ea9a7eebd1397b2fef02b660f33970944a4bb832.tar.bz2
When looking for the present or following EPG event, the running status is now always taken into account
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/epg.c b/epg.c
index 409f83a7..def17ec5 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.55 2006/01/29 13:00:26 kls Exp $
+ * $Id: epg.c 1.56 2006/01/29 14:04:04 kls Exp $
*/
#include "epg.h"
@@ -16,6 +16,8 @@
#include <ctype.h>
#include <time.h>
+#define RUNNINGSTATUSTIMEOUT 30 // seconds before the running status is considered unknown
+
// --- tComponent ------------------------------------------------------------
cString tComponent::ToString(void)
@@ -204,7 +206,7 @@ bool cEvent::HasTimer(void) const
bool cEvent::IsRunning(bool OrAboutToStart) const
{
- return runningStatus >= (OrAboutToStart ? SI::RunningStatusStartsInAFewSeconds : SI::RunningStatusPausing);
+ return SeenWithin(RUNNINGSTATUSTIMEOUT) && runningStatus >= (OrAboutToStart ? SI::RunningStatusStartsInAFewSeconds : SI::RunningStatusPausing);
}
cString cEvent::GetDateString(void) const
@@ -658,25 +660,22 @@ void cSchedule::UnhashEvent(cEvent *Event)
eventsHashStartTime.Del(Event, Event->StartTime());
}
-const cEvent *cSchedule::GetPresentEvent(bool CheckRunningStatus) const
+const cEvent *cSchedule::GetPresentEvent(void) const
{
const cEvent *pe = NULL;
time_t now = time(NULL);
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (p->StartTime() <= now && now < p->EndTime()) {
+ if (p->StartTime() <= now && now < p->EndTime())
pe = p;
- if (!CheckRunningStatus)
- break;
- }
- if (CheckRunningStatus && p->SeenWithin(30) && p->RunningStatus() >= SI::RunningStatusPausing)
+ if (p->SeenWithin(RUNNINGSTATUSTIMEOUT) && p->RunningStatus() >= SI::RunningStatusPausing)
return p;
}
return pe;
}
-const cEvent *cSchedule::GetFollowingEvent(bool CheckRunningStatus) const
+const cEvent *cSchedule::GetFollowingEvent(void) const
{
- const cEvent *p = GetPresentEvent(CheckRunningStatus);
+ const cEvent *p = GetPresentEvent();
if (p)
p = events.Next(p);
return p;