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;
394 if (stime(&dvbtim) == 0)
397 esyslog(
"ERROR while setting system time: %m");
404 if (adjtime(&delta, NULL) == 0)
407 esyslog(
"ERROR while adjusting system time: %m");
419 Set(0x12, 0x40, 0xC0);
446 if (Tid >= 0x4E && Tid <= 0x6F)
int getOriginalNetworkId() const
const cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false) const
bool SetName(const char *Name, const char *ShortName, const char *Provider)
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)
int getVersionNumber() const
bool SetPortalName(const char *PortalName)
void SetComponent(int Index, const char *s)
int getOriginalNetworkId() const
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)
int NumComponents(void) const
time_t getStartTime() const
cString ToDescr(void) const
static void SetDisableUntil(time_t Time)
int getReferenceEventId() const
void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
void SetParentalRating(cEvent *Event, int ParentalRating)
int getContentNibbleLevel1() const
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
void SetTitle(cEvent *Event, const char *Title)
void SetEventID(cEvent *Event, tEventID EventID)
int EPGLanguages[I18N_MAX_LANGUAGES+1]
bool HandledExternally(const cChannel *Channel)
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
bool BeginSegmentTransfer(const cChannel *Channel)
void ClrRunningStatus(cChannel *Channel=NULL)
void HandleEvent(cEvent *Event)
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
void SetStartTime(cEvent *Event, time_t StartTime)
bool Sync(uchar Version, int Number, int LastNumber)
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
#define ISTRANSPONDER(f1, f2)
int getLastDescriptorNumber()
int getContentNibbleLevel2() const
int Source(void)
Returns the source of the data delivered to this filter.
void SetDuration(cEvent *Event, int Duration)
const char * ShortText(void) const
bool Add(GroupDescriptor *d)
static time_t disableUntil
time_t getDuration() const
void FixEpgBugs(cEvent *Event)
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
const cSchedule * GetSchedule(tChannelID ChannelID) const
const cEvent * GetEvent(tEventID EventID, time_t StartTime=0) const
void SortSchedule(cSchedule *Schedule)
void SetPresentSeen(void)
cEvent * AddEvent(cEvent *Event)
int getReferenceServiceId() const
int getSectionNumber() const
void SetVps(cEvent *Event, time_t Vps)
const char * Name(void) const
T * Get(unsigned int Id) const
bool IgnoreChannel(const cChannel *Channel)
int RunningStatus(void) 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...
const char * Title(void) const
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
static cSchedules * GetSchedulesWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for write access.
const unsigned char * getData() const
int getDescriptorNumber()
cEIT(cSectionSyncerHash &SectionSyncerHash, int Source, u_char Tid, const u_char *Data)
int getStreamContent() const
bool SetLinkChannels(cLinkChannels *LinkChannels)
int getTransportStreamId() const
void SetVersion(uchar Version)
cSectionSyncerHash sectionSyncerHash
void Add(cListObject *Object, unsigned int Id)
DescriptorTag getDescriptorTag() const
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")
LinkageType getLinkageType() const
int getTransportStreamId() const
void SetComponents(cEvent *Event, cComponents *Components)
int getComponentType() const
void SetShortText(cEvent *Event, const char *ShortText)
void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel=NULL)
uchar TableID(void) const
bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
const cChannel * GetByTransponderID(tChannelID ChannelID) const
const char * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
void EndSegmentTransfer(bool Modified)
DescriptorLoop eventDescriptors
Descriptor * getNext(Iterator &it)
RunningStatus getRunningStatus() const
int getLastSectionNumber() const
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")
const char * Description(void) const