Go to the documentation of this file.
21 #define VALID_TIME (31536000 * 2) // two years
39 if (!SectionSyncerEntry) {
41 SectionSyncerHash.
Add(SectionSyncerEntry, HashId);
44 if (Tid != 0x4E && !Process)
47 time_t Now = time(NULL);
54 SectionSyncerEntry->
Repeat();
60 ChannelsStateKey.
Remove(
false);
67 SectionSyncerEntry->
Repeat();
68 ChannelsStateKey.
Remove(
false);
73 SchedulesStateKey.
Remove(
false);
74 ChannelsStateKey.
Remove(
false);
78 bool ChannelsModified =
false;
83 bool Modified =
false;
85 time_t SegmentStart = 0;
86 time_t SegmentEnd = 0;
88 localtime_r(&Now, &t);
97 if (StartTime == 0 || StartTime > 0 && Duration == 0)
101 if (StartTime + Duration < LingerLimit)
104 SegmentStart = StartTime;
105 SegmentEnd = StartTime + Duration;
109 if (!pEvent || handledExternally) {
117 if (!handledExternally)
145 int OverrideStatus = -1;
152 if (OverrideStatus >= 0) {
168 int LanguagePreferenceShort = -1;
169 int LanguagePreferenceExt = -1;
170 bool UseExtendedEventDescriptor =
false;
181 delete ExtendedEventDescriptors;
183 UseExtendedEventDescriptor =
true;
185 if (UseExtendedEventDescriptor) {
186 if (ExtendedEventDescriptors->
Add(eed))
190 UseExtendedEventDescriptor =
false;
196 delete ShortEventDescriptor;
197 ShortEventDescriptor = sed;
217 int LanguagePreferenceRating = -1;
222 int ParentalRating = (Rating.
getRating() & 0xFF);
223 switch (ParentalRating) {
225 case 0x01 ... 0x0F: ParentalRating += 3;
break;
227 case 0x11: ParentalRating = 10;
break;
228 case 0x12: ParentalRating = 12;
break;
229 case 0x13: ParentalRating = 16;
break;
230 default: ParentalRating = 0;
240 int month = t.tm_mon;
246 if (month == 11 && t.tm_mon == 0)
248 else if (month == 0 && t.tm_mon == 11)
250 time_t vps = mktime(&t);
271 bool hit = StartTime <= Now && Now < StartTime + Duration;
277 if (link != Channel) {
280 ChannelsModified |= link->
SetName(linkName,
"",
"");
287 ChannelsModified =
true;
306 if (1 <= Stream && Stream <= 6 && Type != 0) {
320 if (ShortEventDescriptor) {
329 if (ExtendedEventDescriptors) {
336 delete ExtendedEventDescriptors;
337 delete ShortEventDescriptor;
346 if (handledExternally)
360 SchedulesStateKey.
Remove(Modified);
361 ChannelsStateKey.
Remove(ChannelsModified);
367 #define MAX_TIME_DIFF 1 // number of seconds the local time may differ from dvb time before making any corrections
368 #define MAX_ADJ_DIFF 10 // number of seconds the local time may differ from dvb time to allow smooth adjustment
369 #define ADJ_DELTA 300 // number of seconds between calls for smooth time adjustment
383 :
SI::TDT(Data, false)
388 time_t loctim = time(NULL);
390 int diff = dvbtim - loctim;
396 if (clock_settime(CLOCK_REALTIME, &ts) == 0)
399 esyslog(
"ERROR while setting system time: %m");
406 if (adjtime(&delta, NULL) == 0)
409 esyslog(
"ERROR while adjusting system time: %m");
421 Set(0x12, 0x40, 0xC0);
448 if (Tid >= 0x4E && Tid <= 0x6F)
bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
int getTransportStreamId() const
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
int getReferenceServiceId() const
int Transponder(void)
Returns the transponder of the data delivered to this filter.
bool SetName(const char *Name, const char *ShortName, const char *Provider)
void SortSchedule(cSchedule *Schedule)
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
cEIT(cSectionSyncerHash &SectionSyncerHash, int Source, u_char Tid, const u_char *Data)
const char * Name(void) const
uchar TableID(void) const
void SetContents(cEvent *Event, uchar *Contents)
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...
bool IgnoreChannel(const cChannel *Channel)
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
void SetComponent(int Index, const char *s)
void Add(cListObject *Object, cListObject *After=NULL)
const char * Title(void) const
void SetTableID(uchar TableID)
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
int getLastSectionNumber() const
void SetEventID(cEvent *Event, tEventID EventID)
int NumComponents(void) const
void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
const cSchedule * GetSchedule(tChannelID ChannelID) const
cString ToDescr(void) const
int getSectionNumber() const
bool SetLinkChannels(cLinkChannels *LinkChannels)
int getReferenceEventId() const
cSectionSyncerHash sectionSyncerHash
void SetVersion(uchar Version)
@ ParentalRatingDescriptorTag
bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
RunningStatus getRunningStatus() const
int getLastDescriptorNumber()
void Add(cListObject *Object, unsigned int Id)
bool Add(GroupDescriptor *d)
const unsigned char * getData() const
int EPGLanguages[I18N_MAX_LANGUAGES+1]
void SetDuration(cEvent *Event, int Duration)
@ RunningStatusNotRunning
DescriptorTag getDescriptorTag() const
void FixEpgBugs(cEvent *Event)
@ TimeShiftedEventDescriptorTag
const cChannel * GetByTransponderID(tChannelID ChannelID) const
void SetPresentSeen(void)
void EndSegmentTransfer(bool Modified)
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
const cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false) const
StructureLoop< Rating > ratingLoop
bool SetPortalName(const char *PortalName)
void SetStartTime(time_t StartTime)
static cSchedules * GetSchedulesWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for write access.
void SetVps(cEvent *Event, time_t Vps)
void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel=NULL)
T * Get(unsigned int Id) const
void SetDescription(cEvent *Event, const char *Description)
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
char * getText(const char *separation1="\t", const char *separation2="\n")
static void SetDisableUntil(time_t Time)
int getOriginalNetworkId() const
int getStreamContent() const
@ ShortEventDescriptorTag
const cEvent * GetEvent(tEventID EventID, time_t StartTime=0) const
bool Sync(uchar Version, int Number, int LastNumber)
time_t getStartTime() const
#define ISTRANSPONDER(f1, f2)
void SetTitle(cEvent *Event, const char *Title)
cEvent * AddEvent(cEvent *Event)
int getDescriptorNumber()
time_t getDuration() const
int getContentNibbleLevel1() const
void SetParentalRating(cEvent *Event, int ParentalRating)
DescriptorLoop eventDescriptors
const char * Description(void) const
Descriptor * getNext(Iterator &it)
int getComponentType() const
bool BeginSegmentTransfer(const cChannel *Channel)
@ ExtendedEventDescriptorTag
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")
void SetShortText(cEvent *Event, const char *ShortText)
int RunningStatus(void) const
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
void ClrRunningStatus(cChannel *Channel=NULL)
bool HandledExternally(const cChannel *Channel)
int Source(void)
Returns the source of the data delivered to this filter.
void SetStartTime(cEvent *Event, time_t StartTime)
StructureLoop< Nibble > nibbleLoop
int getContentNibbleLevel2() const
StructureLoop< Event > eventLoop
int getOriginalNetworkId() const
void SetDuration(int Duration)
void HandleEvent(cEvent *Event)
int getVersionNumber() const
const char * ShortText(void) const
int getTransportStreamId() const
static time_t disableUntil
void SetComponents(cEvent *Event, cComponents *Components)
LinkageType getLinkageType() const