mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed detecting the running status in case an empty EPG event is broadcast
This commit is contained in:
parent
1fd16f6629
commit
56b624d209
@ -950,3 +950,6 @@ St
|
|||||||
|
|
||||||
Marc Hoppe <MarcHoppe@gmx.de>
|
Marc Hoppe <MarcHoppe@gmx.de>
|
||||||
for fixing handling the current menu item
|
for fixing handling the current menu item
|
||||||
|
|
||||||
|
Michael Pennewiß <M.Pennewiss@ARD-Digital.de>
|
||||||
|
for pointing out that an empty EPG event means there is currently no running event
|
||||||
|
2
HISTORY
2
HISTORY
@ -2736,3 +2736,5 @@ Video Disk Recorder Revision History
|
|||||||
- Any newline characters in the 'description' of EPG events are now preserved
|
- Any newline characters in the 'description' of EPG events are now preserved
|
||||||
to allow texts to be displayed the way the tv stations have formatted them.
|
to allow texts to be displayed the way the tv stations have formatted them.
|
||||||
This was also necessary to better display itemized texts.
|
This was also necessary to better display itemized texts.
|
||||||
|
- Fixed detecting the running status in case an empty EPG event is broadcast (thanks
|
||||||
|
to Michael Pennewiß for pointing this out).
|
||||||
|
7
eit.c
7
eit.c
@ -8,7 +8,7 @@
|
|||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
||||||
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
|
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
|
||||||
*
|
*
|
||||||
* $Id: eit.c 1.92 2004/03/07 11:51:57 kls Exp $
|
* $Id: eit.c 1.93 2004/03/13 13:54:20 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "eit.h"
|
#include "eit.h"
|
||||||
@ -43,10 +43,12 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
|
|||||||
Schedules->Add(pSchedule);
|
Schedules->Add(pSchedule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Empty = true;
|
||||||
bool Modified = false;
|
bool Modified = false;
|
||||||
|
|
||||||
SI::EIT::Event SiEitEvent;
|
SI::EIT::Event SiEitEvent;
|
||||||
for (SI::Loop::Iterator it; eventLoop.hasNext(it); ) {
|
for (SI::Loop::Iterator it; eventLoop.hasNext(it); ) {
|
||||||
|
Empty = false;
|
||||||
SiEitEvent = eventLoop.getNext(it);
|
SiEitEvent = eventLoop.getNext(it);
|
||||||
|
|
||||||
cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), SiEitEvent.getStartTime());
|
cEvent *pEvent = (cEvent *)pSchedule->GetEvent(SiEitEvent.getEventId(), SiEitEvent.getStartTime());
|
||||||
@ -212,6 +214,9 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data)
|
|||||||
}
|
}
|
||||||
Modified = true;
|
Modified = true;
|
||||||
}
|
}
|
||||||
|
if (Empty && Tid == 0x4E && getSectionNumber() == 0)
|
||||||
|
// ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
|
||||||
|
pSchedule->ClrRunningStatus(channel);
|
||||||
if (Modified)
|
if (Modified)
|
||||||
pSchedule->Sort();
|
pSchedule->Sort();
|
||||||
}
|
}
|
||||||
|
31
epg.c
31
epg.c
@ -7,7 +7,7 @@
|
|||||||
* Original version (as used in VDR before 1.3.0) written by
|
* Original version (as used in VDR before 1.3.0) written by
|
||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* 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"
|
#include "epg.h"
|
||||||
@ -61,8 +61,11 @@ void cEvent::SetVersion(uchar Version)
|
|||||||
version = 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;
|
runningStatus = RunningStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -471,6 +474,7 @@ void cEvent::FixEpgBugs(void)
|
|||||||
cSchedule::cSchedule(tChannelID ChannelID)
|
cSchedule::cSchedule(tChannelID ChannelID)
|
||||||
{
|
{
|
||||||
channelID = ChannelID;
|
channelID = ChannelID;
|
||||||
|
hasRunning = false;;
|
||||||
}
|
}
|
||||||
|
|
||||||
cEvent *cSchedule::AddEvent(cEvent *Event)
|
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)
|
void cSchedule::SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel)
|
||||||
{
|
{
|
||||||
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
for (cEvent *p = events.First(); p; p = events.Next(p)) {
|
||||||
if (p == Event) {
|
if (p == Event)
|
||||||
if (Channel && p->RunningStatus() != RunningStatus && (RunningStatus > SI::RunningStatusNotRunning || p->RunningStatus() > SI::RunningStatusUndefined))
|
p->SetRunningStatus(RunningStatus, Channel);
|
||||||
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);
|
|
||||||
}
|
|
||||||
else if (RunningStatus >= SI::RunningStatusPausing && p->RunningStatus() > SI::RunningStatusNotRunning)
|
else if (RunningStatus >= SI::RunningStatusPausing && p->RunningStatus() > SI::RunningStatusNotRunning)
|
||||||
p->SetRunningStatus(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)
|
void cSchedule::ResetVersions(void)
|
||||||
|
6
epg.h
6
epg.h
@ -7,7 +7,7 @@
|
|||||||
* Original version (as used in VDR before 1.3.0) written by
|
* Original version (as used in VDR before 1.3.0) written by
|
||||||
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
|
||||||
*
|
*
|
||||||
* $Id: epg.h 1.13 2004/03/06 14:01:38 kls Exp $
|
* $Id: epg.h 1.14 2004/03/13 13:39:13 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __EPG_H
|
#ifndef __EPG_H
|
||||||
@ -61,7 +61,7 @@ public:
|
|||||||
void SetEventID(u_int16_t EventID);
|
void SetEventID(u_int16_t EventID);
|
||||||
void SetTableID(uchar TableID);
|
void SetTableID(uchar TableID);
|
||||||
void SetVersion(uchar Version);
|
void SetVersion(uchar Version);
|
||||||
void SetRunningStatus(int RunningStatus);
|
void SetRunningStatus(int RunningStatus, cChannel *Channel = NULL);
|
||||||
void SetTitle(const char *Title);
|
void SetTitle(const char *Title);
|
||||||
void SetShortText(const char *ShortText);
|
void SetShortText(const char *ShortText);
|
||||||
void SetDescription(const char *Description);
|
void SetDescription(const char *Description);
|
||||||
@ -79,10 +79,12 @@ class cSchedule : public cListObject {
|
|||||||
private:
|
private:
|
||||||
tChannelID channelID;
|
tChannelID channelID;
|
||||||
cList<cEvent> events;
|
cList<cEvent> events;
|
||||||
|
bool hasRunning;
|
||||||
public:
|
public:
|
||||||
cSchedule(tChannelID ChannelID);
|
cSchedule(tChannelID ChannelID);
|
||||||
tChannelID ChannelID(void) const { return channelID; }
|
tChannelID ChannelID(void) const { return channelID; }
|
||||||
void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel = NULL);
|
void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel = NULL);
|
||||||
|
void ClrRunningStatus(cChannel *Channel = NULL);
|
||||||
void ResetVersions(void);
|
void ResetVersions(void);
|
||||||
void Sort(void);
|
void Sort(void);
|
||||||
void Cleanup(time_t Time);
|
void Cleanup(time_t Time);
|
||||||
|
Loading…
Reference in New Issue
Block a user