summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-03-13 15:01:05 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-03-13 15:01:05 +0100
commit56b624d20921863e6a212ba139a09383de382a23 (patch)
tree84db72116841f1980ceea34d5aa28d7d0efb4860 /epg.c
parent1fd16f6629d4297268e6ff8470444a7169421286 (diff)
downloadvdr-56b624d20921863e6a212ba139a09383de382a23.tar.gz
vdr-56b624d20921863e6a212ba139a09383de382a23.tar.bz2
Fixed detecting the running status in case an empty EPG event is broadcast
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/epg.c b/epg.c
index c93594d5..28d8c1d2 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.17 2004/03/13 12:41:24 kls Exp $
+ * $Id: epg.c 1.18 2004/03/13 15:01:05 kls Exp $
*/
#include "epg.h"
@@ -61,8 +61,11 @@ void cEvent::SetVersion(uchar Version)
version = Version;
}
-void cEvent::SetRunningStatus(int RunningStatus)
+void cEvent::SetRunningStatus(int RunningStatus, cChannel *Channel)
{
+ if (Channel && runningStatus != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || runningStatus > SI::RunningStatusUndefined))
+ if (Channel->Number() <= 30)//XXX maybe log only those that have timers???
+ isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), GetTimeString(), Title(), RunningStatus);
runningStatus = RunningStatus;
}
@@ -471,6 +474,7 @@ void cEvent::FixEpgBugs(void)
cSchedule::cSchedule(tChannelID ChannelID)
{
channelID = ChannelID;
+ hasRunning = false;;
}
cEvent *cSchedule::AddEvent(cEvent *Event)
@@ -534,15 +538,26 @@ const cEvent *cSchedule::GetEventAround(time_t Time) const
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
{
for (cEvent *p = events.First(); p; p = events.Next(p)) {
- if (p == Event) {
- if (Channel && p->RunningStatus() != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || p->RunningStatus() > SI::RunningStatusUndefined))
- if (Channel->Number() <= 30)//XXX maybe log only those that have timers???
- isyslog("channel %d (%s) event %s '%s' status %d", Channel->Number(), Channel->Name(), Event->GetTimeString(), Event->Title(), RunningStatus);
- p->SetRunningStatus(RunningStatus);
- }
+ if (p == Event)
+ p->SetRunningStatus(RunningStatus, Channel);
else if (RunningStatus >= SI::RunningStatusPausing && p->RunningStatus() > SI::RunningStatusNotRunning)
p->SetRunningStatus(SI::RunningStatusNotRunning);
}
+ if (RunningStatus >= SI::RunningStatusPausing)
+ hasRunning = true;
+}
+
+void cSchedule::ClrRunningStatus(cChannel *Channel)
+{
+ if (hasRunning) {
+ for (cEvent *p = events.First(); p; p = events.Next(p)) {
+ if (p->RunningStatus() >= SI::RunningStatusPausing) {
+ p->SetRunningStatus(SI::RunningStatusNotRunning, Channel);
+ hasRunning = false;
+ break;
+ }
+ }
+ }
}
void cSchedule::ResetVersions(void)