21 #define VALID_TIME (31536000 * 2) // two years
36 time_t Now = time(NULL);
53 bool Modified =
false;
54 time_t SegmentStart = 0;
55 time_t SegmentEnd = 0;
57 struct tm t = *localtime_r(&Now, &tm_r);
66 if (StartTime == 0 || StartTime > 0 && Duration == 0)
70 SegmentStart = StartTime;
71 SegmentEnd = StartTime + Duration;
75 if (!pEvent || handledExternally) {
76 if (OnlyRunningStatus)
85 if (!handledExternally)
114 if (OnlyRunningStatus) {
120 int LanguagePreferenceShort = -1;
121 int LanguagePreferenceExt = -1;
122 bool UseExtendedEventDescriptor =
false;
133 delete ExtendedEventDescriptors;
135 UseExtendedEventDescriptor =
true;
137 if (UseExtendedEventDescriptor) {
138 ExtendedEventDescriptors->
Add(eed);
142 UseExtendedEventDescriptor =
false;
148 delete ShortEventDescriptor;
149 ShortEventDescriptor = sed;
169 int LanguagePreferenceRating = -1;
174 int ParentalRating = (Rating.
getRating() & 0xFF);
175 switch (ParentalRating) {
177 case 0x01 ... 0x0F: ParentalRating += 3;
break;
179 case 0x11: ParentalRating = 10;
break;
180 case 0x12: ParentalRating = 12;
break;
181 case 0x13: ParentalRating = 16;
break;
182 default: ParentalRating = 0;
192 int month = t.tm_mon;
198 if (month == 11 && t.tm_mon == 0)
200 else if (month == 0 && t.tm_mon == 11)
202 time_t vps = mktime(&t);
223 bool hit = StartTime <= Now && Now < StartTime + Duration;
229 if (link != channel) {
233 link->
SetName(linkName,
"",
"");
258 if (1 <= Stream && Stream <= 6 && Type != 0) {
272 if (ShortEventDescriptor) {
281 if (ExtendedEventDescriptors) {
288 delete ExtendedEventDescriptors;
289 delete ShortEventDescriptor;
298 if (handledExternally)
307 if (Modified && !OnlyRunningStatus) {
317 #define MAX_TIME_DIFF 1 // number of seconds the local time may differ from dvb time before making any corrections
318 #define MAX_ADJ_DIFF 10 // number of seconds the local time may differ from dvb time to allow smooth adjustment
319 #define ADJ_DELTA 300 // number of seconds between calls for smooth time adjustment
333 :
SI::TDT(Data, false)
338 time_t loctim = time(NULL);
340 int diff = dvbtim - loctim;
344 if (stime(&dvbtim) == 0)
347 esyslog(
"ERROR while setting system time: %m");
354 if (adjtime(&delta, NULL) == 0)
357 esyslog(
"ERROR while adjusting system time: %m");
369 Set(0x12, 0x40, 0xC0);
388 if (Tid >= 0x4E && Tid <= 0x6F) {
401 cEIT EIT(Schedules,
Source(), Tid, Data,
true);
int getOriginalNetworkId() const
int getReferenceEventId() const
void SetContents(cEvent *Event, uchar *Contents)
StructureLoop< Nibble > nibbleLoop
StructureLoop< Rating > ratingLoop
bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
void SetComponent(int Index, const char *s)
void SetDescription(cEvent *Event, const char *Description)
void SetStartTime(time_t StartTime)
void SetDuration(int Duration)
StructureLoop< Event > eventLoop
void SetTableID(uchar TableID)
void Add(cListObject *Object, cListObject *After=NULL)
static void SetDisableUntil(time_t Time)
void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
int getTransportStreamId() const
void SetParentalRating(cEvent *Event, int ParentalRating)
void SetTitle(cEvent *Event, const char *Title)
time_t getDuration() const
void SetEventID(cEvent *Event, tEventID EventID)
int EPGLanguages[I18N_MAX_LANGUAGES+1]
DescriptorTag getDescriptorTag() const
bool HandledExternally(const cChannel *Channel)
static const cSchedules * Schedules(cSchedulesLock &SchedulesLock)
Caller must provide a cSchedulesLock which has to survive the entire time the returned cSchedules is ...
void ClrRunningStatus(cChannel *Channel=NULL)
void HandleEvent(cEvent *Event)
int getSectionNumber() const
void SetStartTime(cEvent *Event, time_t StartTime)
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
void SetName(const char *Name, const char *ShortName, const char *Provider)
uchar TableID(void) const
#define ISTRANSPONDER(f1, f2)
int getLastDescriptorNumber()
int Source(void)
Returns the source of the data delivered to this filter.
int getContentNibbleLevel2() const
const cEvent * GetEvent(tEventID EventID, time_t StartTime=0) const
void SetDuration(cEvent *Event, int Duration)
static time_t disableUntil
int getOriginalNetworkId() const
void FixEpgBugs(cEvent *Event)
bool Lock(bool Write, int TimeoutMs=0)
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
void SetRunningStatus(cEvent *Event, int RunningStatus, cChannel *Channel=NULL)
void SortSchedule(cSchedule *Schedule)
LinkageType getLinkageType() const
RunningStatus getRunningStatus() const
int getContentNibbleLevel1() const
static void SetModified(cSchedule *Schedule)
cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bool OnlyRunningStatus=false)
cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false)
void SetPresentSeen(void)
void Add(GroupDescriptor *d)
time_t getStartTime() const
cEvent * AddEvent(cEvent *Event)
const char * Title(void) const
void SetVps(cEvent *Event, time_t Vps)
bool IgnoreChannel(const cChannel *Channel)
const cSchedule * GetSchedule(tChannelID ChannelID) const
bool I18nIsPreferredLanguage(int *PreferredLanguages, const char *LanguageCode, int &OldPreference, int *Position)
Checks the given LanguageCode (which may be something like "eng" or "eng+deu") against the PreferredL...
void SetLinkChannels(cLinkChannels *LinkChannels)
int getDescriptorNumber()
int getVersionNumber() const
int getTransportStreamId() const
int getReferenceServiceId() const
int getStreamContent() const
int NumComponents(void) const
const char * Description(void) const
void SetVersion(uchar Version)
cChannel * GetByTransponderID(tChannelID ChannelID)
int Transponder(void)
Returns the transponder of the data delivered to this filter.
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
char * getText(const char *separation1="\t", const char *separation2="\n")
void SetComponents(cEvent *Event, cComponents *Components)
void SetShortText(cEvent *Event, const char *ShortText)
const char * ShortText(void) const
void SetPortalName(const char *PortalName)
bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
int getComponentType() const
const unsigned char * getData() const
DescriptorLoop eventDescriptors
uchar Version(void) const
Descriptor * getNext(Iterator &it)
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")