21 #define VALID_TIME (31536000 * 2)
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;
307 if ((1 <= Stream && Stream <= 6 && Type != 0)
308 || (Stream == 9 && Ext < 2)) {
324 if (ShortEventDescriptor) {
333 if (ExtendedEventDescriptors) {
340 delete ExtendedEventDescriptors;
341 delete ShortEventDescriptor;
350 if (handledExternally)
364 SchedulesStateKey.
Remove(Modified);
365 ChannelsStateKey.
Remove(ChannelsModified);
371 #define MAX_TIME_DIFF 1
372 #define MAX_ADJ_DIFF 10
373 #define ADJ_DELTA 300
387 :
SI::TDT(Data, false)
392 time_t loctim = time(NULL);
394 int diff = dvbtim - loctim;
400 if (clock_settime(CLOCK_REALTIME, &ts) == 0)
403 esyslog(
"ERROR while setting system time: %m");
410 if (adjtime(&delta, NULL) == 0)
413 esyslog(
"ERROR while adjusting system time: %m");
425 Set(0x12, 0x40, 0xC0);
452 if (Tid >= 0x4E && Tid <= 0x6F)
#define ISTRANSPONDER(f1, f2)
const unsigned char * getData() const
int getComponentType() const
int getStreamContentExt() const
int getStreamContent() const
int getContentNibbleLevel1() const
int getContentNibbleLevel2() const
StructureLoop< Nibble > nibbleLoop
bool Add(GroupDescriptor *d)
Descriptor * getNext(Iterator &it)
DescriptorTag getDescriptorTag() const
DescriptorLoop eventDescriptors
time_t getDuration() const
time_t getStartTime() const
RunningStatus getRunningStatus() const
int getOriginalNetworkId() const
StructureLoop< Event > eventLoop
int getTransportStreamId() const
int getLastDescriptorNumber()
int getDescriptorNumber()
char * getText(const char *separation1="\t", const char *separation2="\n")
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")
int getOriginalNetworkId() const
int getTransportStreamId() const
LinkageType getLinkageType() const
int getSectionNumber() const
int getLastSectionNumber() const
int getVersionNumber() const
StructureLoop< Rating > ratingLoop
int getReferenceServiceId() const
int getReferenceEventId() const
bool SetName(const char *Name, const char *ShortName, const char *Provider)
bool SetPortalName(const char *PortalName)
bool SetLinkChannels(cLinkChannels *LinkChannels)
const char * Name(void) const
static cChannels * GetChannelsWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of channels for write access.
cChannel * NewChannel(const cChannel *Transponder, const char *Name, const char *ShortName, const char *Provider, int Nid, int Tid, int Sid, int Rid=0)
const cChannel * GetByTransponderID(tChannelID ChannelID) const
const cChannel * GetByChannelID(tChannelID ChannelID, bool TryWithoutRid=false, bool TryWithoutPolarization=false) const
int NumComponents(void) const
void SetComponent(int Index, const char *s)
cEIT(cSectionSyncerHash &SectionSyncerHash, int Source, u_char Tid, const u_char *Data)
virtual void Process(u_short Pid, u_char Tid, const u_char *Data, int Length)
Processes the data delivered to this filter.
static void SetDisableUntil(time_t Time)
cSectionSyncerHash sectionSyncerHash
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
static time_t disableUntil
void SortSchedule(cSchedule *Schedule)
void EndSegmentTransfer(bool Modified)
bool IgnoreChannel(const cChannel *Channel)
bool HandleEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version)
void SetStartTime(cEvent *Event, time_t StartTime)
void SetTitle(cEvent *Event, const char *Title)
void DropOutdated(cSchedule *Schedule, time_t SegmentStart, time_t SegmentEnd, uchar TableID, uchar Version)
bool IsUpdate(tEventID EventID, time_t StartTime, uchar TableID, uchar Version)
void FixEpgBugs(cEvent *Event)
void HandleEvent(cEvent *Event)
void SetComponents(cEvent *Event, cComponents *Components)
void SetVps(cEvent *Event, time_t Vps)
void SetParentalRating(cEvent *Event, int ParentalRating)
bool BeginSegmentTransfer(const cChannel *Channel)
bool HandledExternally(const cChannel *Channel)
void SetContents(cEvent *Event, uchar *Contents)
void SetShortText(cEvent *Event, const char *ShortText)
void SetDuration(cEvent *Event, int Duration)
void SetDescription(cEvent *Event, const char *Description)
void SetEventID(cEvent *Event, tEventID EventID)
cString ToDescr(void) const
uchar TableID(void) const
int RunningStatus(void) const
void SetStartTime(time_t StartTime)
const char * Title(void) const
void SetVersion(uchar Version)
void SetDuration(int Duration)
const char * ShortText(void) const
void SetTableID(uchar TableID)
const char * Description(void) const
void Set(u_short Pid, u_char Tid, u_char Mask=0xFF)
Sets the given filter data by calling Add() with Sticky = true.
int Transponder(void)
Returns the transponder of the data delivered to this filter.
virtual void SetStatus(bool On)
Turns this filter on or off, depending on the value of On.
int Source(void)
Returns the source of the data delivered to this filter.
void Add(cListObject *Object, unsigned int Id)
T * Get(unsigned int Id) const
void Add(cListObject *Object, cListObject *After=NULL)
void SetRunningStatus(cEvent *Event, int RunningStatus, const cChannel *Channel=NULL)
const cEvent * GetEvent(tEventID EventID, time_t StartTime=0) const
void SetPresentSeen(void)
void ClrRunningStatus(cChannel *Channel=NULL)
cEvent * AddEvent(cEvent *Event)
static cSchedules * GetSchedulesWrite(cStateKey &StateKey, int TimeoutMs=0)
Gets the list of schedules for write access.
const cSchedule * GetSchedule(tChannelID ChannelID) const
int EPGLanguages[I18N_MAX_LANGUAGES+1]
void Remove(bool IncState=true)
Removes this key from the lock it was previously used with.
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 * I18nNormalizeLanguageCode(const char *Code)
Returns a 3 letter language code that may not be zero terminated.
@ RunningStatusNotRunning
@ ExtendedEventDescriptorTag
@ ShortEventDescriptorTag
@ ParentalRatingDescriptorTag
@ TimeShiftedEventDescriptorTag