21 #define VALID_TIME (31536000 * 2) // two years 36 time_t Now = time(NULL);
54 bool Modified =
false;
55 time_t SegmentStart = 0;
56 time_t SegmentEnd = 0;
58 localtime_r(&Now, &t);
67 if (StartTime == 0 || StartTime > 0 && Duration == 0)
71 SegmentStart = StartTime;
72 SegmentEnd = StartTime + Duration;
76 if (!pEvent || handledExternally) {
77 if (OnlyRunningStatus)
86 if (!handledExternally)
115 if (OnlyRunningStatus) {
121 int LanguagePreferenceShort = -1;
122 int LanguagePreferenceExt = -1;
123 bool UseExtendedEventDescriptor =
false;
134 delete ExtendedEventDescriptors;
136 UseExtendedEventDescriptor =
true;
138 if (UseExtendedEventDescriptor) {
139 if (ExtendedEventDescriptors->
Add(eed))
143 UseExtendedEventDescriptor =
false;
149 delete ShortEventDescriptor;
150 ShortEventDescriptor = sed;
170 int LanguagePreferenceRating = -1;
175 int ParentalRating = (Rating.
getRating() & 0xFF);
176 switch (ParentalRating) {
178 case 0x01 ... 0x0F: ParentalRating += 3;
break;
180 case 0x11: ParentalRating = 10;
break;
181 case 0x12: ParentalRating = 12;
break;
182 case 0x13: ParentalRating = 16;
break;
183 default: ParentalRating = 0;
193 int month = t.tm_mon;
199 if (month == 11 && t.tm_mon == 0)
201 else if (month == 0 && t.tm_mon == 11)
203 time_t vps = mktime(&t);
224 bool hit = StartTime <= Now && Now < StartTime + Duration;
230 if (link != channel) {
234 link->
SetName(linkName,
"",
"");
259 if (1 <= Stream && Stream <= 6 && Type != 0) {
273 if (ShortEventDescriptor) {
282 if (ExtendedEventDescriptors) {
289 delete ExtendedEventDescriptors;
290 delete ShortEventDescriptor;
299 if (handledExternally)
308 if (Modified && !OnlyRunningStatus) {
319 #define MAX_TIME_DIFF 1 // number of seconds the local time may differ from dvb time before making any corrections 320 #define MAX_ADJ_DIFF 10 // number of seconds the local time may differ from dvb time to allow smooth adjustment 321 #define ADJ_DELTA 300 // number of seconds between calls for smooth time adjustment 335 :
SI::TDT(Data, false)
340 time_t loctim = time(NULL);
342 int diff = dvbtim - loctim;
346 if (stime(&dvbtim) == 0)
349 esyslog(
"ERROR while setting system time: %m");
356 if (adjtime(&delta, NULL) == 0)
359 esyslog(
"ERROR while adjusting system time: %m");
371 Set(0x12, 0x40, 0xC0);
383 if (time(NULL) > disableUntil)
390 if (Tid >= 0x4E && Tid <= 0x6F) {
394 cEIT EIT(Schedules, Source(), Tid, Data);
403 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 getContentNibbleLevel2() const
const cEvent * GetEvent(tEventID EventID, time_t StartTime=0) const
void SetDuration(cEvent *Event, int Duration)
bool Add(GroupDescriptor *d)
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)
time_t getStartTime() const
cEvent * AddEvent(cEvent *Event)
const char * Title(void) const
void SetVps(cEvent *Event, time_t Vps)
void BeginSegmentTransfer(const cChannel *Channel, bool OnlyRunningStatus)
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)
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)
void EndSegmentTransfer(bool Modified, bool OnlyRunningStatus)
int getMaximumTextLength(const char *separation1="\t", const char *separation2="\n")