summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2016-06-17 19:04:11 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2016-06-17 19:04:11 (GMT)
commit7f7ec60c3654f318fc4ec918a29b8b95c8c4a25e (patch)
treee2d07dd0d047255b1a7311f7293cca52eaa31e1d
parentbae08c5a8299861111afadde92b3fbce34e758e8 (diff)
downloadvdr-plugin-eepg-7f7ec60c3654f318fc4ec918a29b8b95c8c4a25e.tar.gz
vdr-plugin-eepg-7f7ec60c3654f318fc4ec918a29b8b95c8c4a25e.tar.bz2
vdr 2.3.1 compatibility
-rw-r--r--eepg.c70
-rw-r--r--eit2.c43
-rw-r--r--eit2.h5
-rw-r--r--epghandler.c4
-rw-r--r--equivhandler.c17
-rw-r--r--util.c42
-rw-r--r--util.h2
7 files changed, 139 insertions, 44 deletions
diff --git a/eepg.c b/eepg.c
index f55f9ed..afab8bc 100644
--- a/eepg.c
+++ b/eepg.c
@@ -1001,7 +1001,7 @@ int cFilterEEPG::GetChannelsMHW (const u_char * Data, int Length)
C->Tid = HILO16 (Channel->TransportId);
C->Sid = HILO16 (Channel->ServiceId);
tChannelID channelID = tChannelID (C->Src, C->Nid, C->Tid, C->Sid);
- cChannel *VC = GetChannelByID(channelID, true);
+ const cChannel *VC = GetChannelByID(channelID, true);
bool IsFound = (VC);
if(IsFound) {
C->Src = VC->Source();
@@ -1515,8 +1515,12 @@ void cFilterEEPG::GetTitlesNagra (const u_char * Data, int Length, unsigned shor
unsigned short int CurrentYear = tmCurrent->tm_year;
unsigned short int CurrentMonth = tmCurrent->tm_mon;
//esyslog("EEPGDEBUG: CurrentMonthday=%i, TableIdExtension:%04x, MonthdayTitles=%i.",CurrentMonthday,TableIdExtension, MonthdayTitles);
+#if APIVERSNUM >= 20300
+ LOCK_SCHEDULES_WRITE;
+#else
cSchedulesLock SchedulesLock (true);
- cSchedules *s = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+ cSchedules *Schedules = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+#endif
do { //process each block of titles
sTitleBlockNagraGuide *TB = (sTitleBlockNagraGuide *) p;
int ChannelId = HILO16 (TB->ChannelId);
@@ -1535,7 +1539,7 @@ void cFilterEEPG::GetTitlesNagra (const u_char * Data, int Length, unsigned shor
sChannel *C = &sChannels[ChannelSeq[ChannelId]]; //find channel
//cSchedule *ps = NULL;//[MAX_EQUIVALENCES];
- //PrepareToWriteToSchedule (C, s, ps);
+ //PrepareToWriteToSchedule (C, Schedules, ps);
for (int i = 0; i < NumberOfTitles; i++) { //process each title within block
sTitleNagraGuide *Title = (sTitleNagraGuide *) p;
@@ -1586,7 +1590,7 @@ void cFilterEEPG::GetTitlesNagra (const u_char * Data, int Length, unsigned shor
if (Themes[Title->ThemeId][0] == 0x00) //if detailed themeid is not known, get global themeid
Title->ThemeId &= 0xf0;
- WriteToSchedule (tChannelID (C->Src, C->Nid, C->Tid, C->Sid), s, EventId, StartTime, Title->Duration, Text, SummText,
+ WriteToSchedule (tChannelID (C->Src, C->Nid, C->Tid, C->Sid), Schedules, EventId, StartTime, Title->Duration, Text, SummText,
Title->ThemeId, NAGRA_TABLE_ID, Version);
if (Text != NULL)
@@ -1625,7 +1629,7 @@ void cFilterEEPG::GetTitlesNagra (const u_char * Data, int Length, unsigned shor
} //end for titles
//FinishWriteToSchedule (C, s, ps);
- sortSchedules(s, tChannelID (C->Src, C->Nid, C->Tid, C->Sid));
+ sortSchedules(Schedules, tChannelID (C->Src, C->Nid, C->Tid, C->Sid));
p = next_p;
} while (p < DataEnd); //end of TitleBlock
}
@@ -1748,7 +1752,7 @@ int cFilterEEPG::GetChannelsNagra (const u_char * Data, int Length)
C->Tid = HILO16 (Channel->TransportId);
C->Sid = HILO16 (Channel->ServiceId);
tChannelID channelID = tChannelID(C->Src, C->Nid, C->Tid, C->Sid);
- cChannel *VC = GetChannelByID(channelID, true);
+ const cChannel *VC = GetChannelByID(channelID, true);
bool IsFound = (VC);
if(IsFound) {
strncpy((char*)(C->Name), VC->Name (), 64);
@@ -2318,7 +2322,7 @@ int cFilterEEPG::GetChannelsSKYBOX (const u_char * Data, int Length)
C->Sid = Sid;
C->SkyNumber = SkyNumber;
tChannelID channelID = tChannelID (C->Src, C->Nid, C->Tid, C->Sid);
- cChannel *VC = Channels.GetByChannelID (channelID, true);
+ const cChannel *VC = GetChannelByID (channelID, false);
bool IsFound = (VC);
if (IsFound)
strncpy ((char *) C->Name, VC->Name (), 64);
@@ -2592,9 +2596,13 @@ void cFilterEEPG::LoadIntoSchedule (void)
bool isOTV = Format == SKY_IT || Format == SKY_UK;
{
+#if APIVERSNUM >= 20300
+ LOCK_SCHEDULES_WRITE;
+#else
cSchedulesLock SchedulesLock (true);
- cSchedules *s = (cSchedules *) cSchedules::Schedules (SchedulesLock);
- if (s) {
+ cSchedules *Schedules = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+#endif
+ if (Schedules) {
while (i < nTitles) {
S = Summaries[j];
@@ -2646,7 +2654,7 @@ void cFilterEEPG::LoadIntoSchedule (void)
//channelids are sequentially numbered and sent in MHW1 and MHW2, but not in SKY, so we need to lookup the table index
sChannel *C = &sChannels[ChannelSeq[ChannelId]]; //find channel
//cSchedule *p;//[MAX_EQUIVALENCES];
- //PrepareToWriteToSchedule (C, s, p);
+ //PrepareToWriteToSchedule (C, Schedules, p);
tChannelID chanID = tChannelID (C->Src, C->Nid, C->Tid, C->Sid);
char rating = 0x00;
@@ -2661,12 +2669,12 @@ void cFilterEEPG::LoadIntoSchedule (void)
// LogD (0, prep("EventId %08x Titlenr:%d,SummNr:%d,SummAv:%x,Un1:%x,Un2:%x,Un3:%x,Name:%s,STxtLn:%d,Summary:%s."),
// T->EventId, i, j, T->SummaryAvailable, T->Unknown1, T->Unknown2, T->Unknown3, T->Text, S->ShortTextLength, S->Text);
- WriteToSchedule (chanID, s, T->EventId, StartTime, T->Duration / 60, (char *) T->Text,
+ WriteToSchedule (chanID, Schedules, T->EventId, StartTime, T->Duration / 60, (char *) T->Text,
(char *) S->Text, T->ThemeId, TableId, 0, rating, S->ShortTextLength);
- sortSchedules(s, chanID);
+ sortSchedules(Schedules, chanID);
//if (shortText != NULL) delete [] shortText;
- //FinishWriteToSchedule (C, s, p);
+ //FinishWriteToSchedule (C, Schedules, p);
//Replays--;
//if ((S->NumReplays != 0) && (Replays > 0)) { //when replays are used, all summaries of the replays are stored consecutively; currently only CSAT
//j++; //move to next summary
@@ -2704,15 +2712,15 @@ void cFilterEEPG::LoadIntoSchedule (void)
sChannel *C = &sChannels[ChannelSeq[T->ChannelId]]; //find channel
//cSchedule *p;//[MAX_EQUIVALENCES];
tChannelID chanID = tChannelID (C->Src, C->Nid, C->Tid, C->Sid);
- //PrepareToWriteToSchedule (C, s, p);
+ //PrepareToWriteToSchedule (C, Schedules, p);
char rating = 0x00;
if (!isOTV && T->Rating) { //TODO only works on OTV for now
rating = T->Rating;
}
- WriteToSchedule (chanID, s, T->EventId, T->StartTime, T->Duration / 60, (char *) T->Text,
+ WriteToSchedule (chanID, Schedules, T->EventId, T->StartTime, T->Duration / 60, (char *) T->Text,
NULL, T->ThemeId, DEFAULT_TABLE_ID, 0, rating, S->ShortTextLength);
- //FinishWriteToSchedule (C, s, p);
- sortSchedules(s, chanID);
+ //FinishWriteToSchedule (C, Schedules, p);
+ sortSchedules(Schedules, chanID);
SummariesNotFound++;
}
@@ -2909,12 +2917,19 @@ void cFilterEEPG::ProccessContinuous(u_short Pid, u_char Tid, int Length, const
{
//0x39 Viasat, 0x0300 Dish Network EEPG, 0x0441 Bell ExpressVU EEPG
LogD(4, prep("Pid: 0x%02x Tid: %d Length: %d"), Pid, Tid, Length);
+#if APIVERSNUM >= 20300
+ LOCK_SCHEDULES_WRITE;
+// cStateKey SchedulesStateKey;
+// cSchedules *Schedules = cSchedules::GetSchedulesWrite(SchedulesStateKey, 10);
+#else
cSchedulesLock SchedulesLock(true, 10);
cSchedules *Schedules = (cSchedules*)(cSchedules::Schedules(SchedulesLock));
+#endif
//Look for other satelite positions only if Dish/Bell ExpressVU for the moment hardcoded pid check
if(Schedules)
SI::cEIT2 EIT(Schedules, Source(), Tid, Data, Format, Pid == EIT_PID);
+#if APIVERSNUM < 20300
else//cEIT EIT (Schedules, Source (), Tid, Data);
{
// If we don't get a write lock, let's at least get a read lock, so
@@ -2928,6 +2943,7 @@ void cFilterEEPG::ProccessContinuous(u_short Pid, u_char Tid, int Length, const
//cEIT EIT (Schedules, Source (), Tid, Data, true);
}
+#endif
}
void cFilterEEPG::Process (u_short Pid, u_char Tid, const u_char * Data, int Length)
@@ -3295,8 +3311,12 @@ void cFilterEEPG::ProcessPremiere(const u_char *& Data)
SI::PremiereCIT cit(Data, false);
if (cit.CheckCRCAndParse ()) {
+#if APIVERSNUM >= 20300
+ LOCK_SCHEDULES_WRITE;
+#else
cSchedulesLock SchedulesLock (true, 10);
cSchedules *Schedules = (cSchedules *) cSchedules::Schedules (SchedulesLock);
+#endif
if (Schedules) {
int now = time (0);
int nCount = 0;
@@ -3438,7 +3458,12 @@ void cFilterEEPG::ProcessPremiere(const u_char *& Data)
}
}
tChannelID channelID (Source (), nid, tid, sid);
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_READ;
+ const cChannel *channel = Channels->GetByChannelID (channelID, true);
+#else
cChannel *channel = Channels.GetByChannelID (channelID, true);
+#endif
if (!channel)
continue;
@@ -3543,7 +3568,11 @@ void cFilterEEPG::ProcessPremiere(const u_char *& Data)
}
if (Modified) {
pSchedule->Sort ();
+#if APIVERSNUM >= 20300
+ pSchedule->SetModified();
+#else
Schedules->SetModified (pSchedule);
+#endif
}
delete pct;
}
@@ -3669,7 +3698,12 @@ bool cPluginEEPG::Start (void)
tables[0][0] = NULL;
//store all available sources, so when a channel is not found on current satellite, we can look for alternate sat positions.
//perhaps this can be done smarter through existing VDR function???
- for (cChannel * Channel = Channels.First (); Channel; Channel = Channels.Next (Channel)) {
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_READ;
+ for (const cChannel * Channel = Channels->First(); Channel; Channel = Channels->Next(Channel)) {
+#else
+ for (const cChannel * Channel = Channels.First (); Channel; Channel = Channels.Next (Channel)) {
+#endif
if (!Channel->GroupSep ()) {
bool found = false;
for (int i = 0; (i < NumberOfAvailableSources) && (!found); i++)
diff --git a/eit2.c b/eit2.c
index d5f928b..63f6187 100644
--- a/eit2.c
+++ b/eit2.c
@@ -76,14 +76,21 @@ cEvent* cEIT2::ProcessEitEvent(cSchedule* pSchedule,const SI::EIT::Event* EitEve
pSchedule->AddEvent (newEvent);
if (Tid == 0x4E) { // we trust only the present/following info on the actual TS
if (EitEvent->getRunningStatus () >= SI::RunningStatusNotRunning)
- pSchedule->SetRunningStatus (pEvent, EitEvent->getRunningStatus (), channel);
+ {
+#if APIVERSNUM >= 20300
+ pSchedule->SetRunningStatus (pEvent, EitEvent->getRunningStatus (), channel);
+#else
+ cChannel* chan = Channels.GetByChannelID(channel->GetChannelID());
+ pSchedule->SetRunningStatus (pEvent, EitEvent->getRunningStatus (), chan);
+#endif
+ }
}
if (OnlyRunningStatus)
return NULL; // do this before setting the version, so that the full update can be done later
pEvent->SetVersion (versionNumber);
ProcessEventDescriptors(ExternalData, channel->Source(), Tid, EitEvent,
- pEvent, Schedules, channel);
+ pEvent, Schedules, channel->GetChannelID());
Modified = true;
return pEvent;
@@ -91,7 +98,7 @@ cEvent* cEIT2::ProcessEitEvent(cSchedule* pSchedule,const SI::EIT::Event* EitEve
void cEIT2::ProcessEventDescriptors(bool ExternalData, int Source,
u_char Tid, const SI::EIT::Event* SiEitEvent, cEvent* pEvent,
- cSchedules* Schedules, cChannel* channel)
+ cSchedules* Schedules, const tChannelID& channelId)
{
cEvent *rEvent = NULL;
@@ -110,6 +117,13 @@ void cEIT2::ProcessEventDescriptors(bool ExternalData, int Source,
cLinkChannels *LinkChannels = NULL;
cComponents *Components = NULL;
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_WRITE;
+ if (!Channels) return;
+ cChannel *channel = Channels->GetByChannelID(channelId);
+#else
+ cChannel *channel = Channels.GetByChannelID(channelId);
+#endif
DescriptorLoop dl = SiEitEvent->eventDescriptors;
for (SI::Loop::Iterator it2; (d = dl.getNext(it2)); )
@@ -247,7 +261,11 @@ void cEIT2::ProcessEventDescriptors(bool ExternalData, int Source,
char linkName[ld->privateData.getLength() + 1];
strn0cpy(linkName, (const char *) ld->privateData.getData(), sizeof(linkName));
// TODO is there a standard way to determine the character set of this string?
+#if APIVERSNUM >= 20300
+ cChannel *link = Channels->GetByChannelID(linkID);
+#else
cChannel *link = Channels.GetByChannelID(linkID);
+#endif
if (link != channel) { // only link to other channels, not the same one
//fprintf(stderr, "Linkage %s %4d %4d %5d %5d %5d %5d %02X '%s'\n", hit ? "*" : "", channel->Number(), link ? link->Number() : -1, SiEitEvent.getEventId(), ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId(), ld->getLinkageType(), linkName);//XXX
if (link) {
@@ -255,10 +273,15 @@ void cEIT2::ProcessEventDescriptors(bool ExternalData, int Source,
link->SetName(linkName, "", "");
}
else if (Setup.UpdateChannels >= 4) {
- cChannel *transponder = channel;
+ const cChannel *transponder = channel;
if (channel->Tid() != ld->getTransportStreamId())
+#if APIVERSNUM >= 20300
+ transponder = Channels->GetByTransponderID(linkID);
+ link = Channels->NewChannel(transponder, linkName, "", "", ld->getOriginalNetworkId(),
+#else
transponder = Channels.GetByTransponderID(linkID);
link = Channels.NewChannel(transponder, linkName, "", "", ld->getOriginalNetworkId(),
+#endif
ld->getTransportStreamId(), ld->getServiceId());
}
if (link) {
@@ -549,8 +572,16 @@ cEIT2::cEIT2 (cSchedules * Schedules, int Source, u_char Tid, const u_char * Dat
////
if (Empty && Tid == 0x4E && getSectionNumber () == 0)
- // ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
- pSchedule->ClrRunningStatus (channel);
+ // ETR 211: an empty entry in section 0 of table 0x4E means there is currently no event running
+ {
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_WRITE;
+ cChannel *chan = Channels->GetByChannelID(channel->GetChannelID());
+#else
+ cChannel *chan = Channels.GetByChannelID(channel->GetChannelID());
+#endif
+ pSchedule->ClrRunningStatus (chan);
+ }
if (Tid == 0x4E)
pSchedule->SetPresentSeen ();
if (OnlyRunningStatus) {
diff --git a/eit2.h b/eit2.h
index 0cfd6e6..b9e6298 100644
--- a/eit2.h
+++ b/eit2.h
@@ -62,7 +62,7 @@ public:
private:
void ProcessEventDescriptors(bool ExternalData, int Source, u_char Tid,
const SI::EIT::Event* SiEitEvent, cEvent* pEvent,
- cSchedules* Schedules, cChannel* channel);
+ cSchedules* Schedules, const tChannelID& channelID);
private:
bool Empty;
@@ -73,8 +73,7 @@ private:
time_t SegmentEnd;
cSchedules* Schedules;
EFormat Format;
- cChannel* channel;
-
+ const cChannel* channel;
};
} //end namespace SI
diff --git a/epghandler.c b/epghandler.c
index a80600c..1e2db9f 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -108,7 +108,7 @@ void cEEpgHandler::FindDuplicate(cEvent* Event, const char* newTitle)
{
if (!newTitle || !searchDuplicates) return;
- for (cEvent *ev = schedule->Events()->First(); ev; ev = schedule->Events()->Next(ev)) {
+ for (const cEvent *ev = schedule->Events()->First(); ev; ev = schedule->Events()->Next(ev)) {
//assume that events are already sorted.
if (ev->StartTime() > Event->EndTime()) break;
if (ev->Title() && strcasecmp(ev->Title(), newTitle) == 0
@@ -117,7 +117,7 @@ void cEEpgHandler::FindDuplicate(cEvent* Event, const char* newTitle)
LogD(0, prep("!!!Deleting Event id o:%d n:%d; title o:%s n:%s; start_time o:%d n:%d; duration o:%d n:%d"),
ev->EventID(), Event->EventID(), ev->Title(), newTitle, ev->StartTime(), Event->StartTime(), ev->Duration(), Event->Duration());
- RemoveEvent(ev);
+ RemoveEvent((cEvent*)ev);
break;
}
}
diff --git a/equivhandler.c b/equivhandler.c
index 745f513..75007ec 100644
--- a/equivhandler.c
+++ b/equivhandler.c
@@ -77,7 +77,12 @@ void cEquivHandler::loadEquivalentChannelMap (void)
tChannelID OriginalChID = tChannelID (cSource::FromString (source), nid, tid, sid, rid);
bool found = false;
//int i = 0;
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_READ;
+ const cChannel *OriginalChannel = Channels->GetByChannelID(OriginalChID, false);
+#else
cChannel *OriginalChannel = Channels.GetByChannelID (OriginalChID, false);
+#endif
if (!OriginalChannel) {
LogI(2, prep("Warning, not found EPG channel \'%s\' in channels.conf. Equivalence is assumed to be valid, but perhaps you should check the entry in the equivalents file"), origChanID);
continue;
@@ -89,7 +94,11 @@ void cEquivHandler::loadEquivalentChannelMap (void)
rid = 0;
}
tChannelID EquivChID = tChannelID (cSource::FromString (source), nid, tid, sid, rid);
+#if APIVERSNUM >= 20300
+ const cChannel *EquivChannel = Channels->GetByChannelID(EquivChID, false);
+#else
cChannel *EquivChannel = Channels.GetByChannelID (EquivChID, false);
+#endif
if (!EquivChannel) {
LogI(0, prep("Warning, not found equivalent channel \'%s\' in channels.conf"), equiChanID);
continue;
@@ -130,7 +139,7 @@ void cEquivHandler::updateEquivalent(cSchedules * Schedules, tChannelID channelI
for (it=ret.first; it!=ret.second; ++it) {
LogD(2, prep("equivalent channel exists"));
tChannelID equChannelID (tChannelID::FromString((*it).second.c_str()));
- cChannel *equChannel = GetChannelByID (equChannelID, false);
+ const cChannel *equChannel = GetChannelByID (equChannelID, false);
if (equChannel) {
LogD(2, prep("found Equivalent channel %s"), *equChannelID.ToString());
cSchedule *pSchedule = (cSchedule *) Schedules->GetSchedule (equChannel, true);
@@ -192,14 +201,18 @@ void cEquivHandler::sortEquivalents(tChannelID channelID, cSchedules* Schedules)
{
LogD(3, prep("equivalent channel exists"));
tChannelID equChannelID(tChannelID::FromString((*it).second.c_str()));
- cChannel* pChannel = GetChannelByID(equChannelID, false);
+ const cChannel* pChannel = GetChannelByID(equChannelID, false);
if (pChannel)
{
LogD(2, prep("found Equivalent channel %s"), *equChannelID.ToString());
cSchedule* pSchedule = (cSchedule *) Schedules->GetSchedule(pChannel, true);
pSchedule->Sort();
+#if APIVERSNUM >= 20300
+ pSchedule->SetModified();
+#else
Schedules->SetModified(pSchedule);
+#endif
}
}
}
diff --git a/util.c b/util.c
index 0373d1a..b41faf8 100644
--- a/util.c
+++ b/util.c
@@ -30,14 +30,23 @@ map<string,string> tableDict;
cEquivHandler* EquivHandler;
-cChannel *GetChannelByID(tChannelID & channelID, bool searchOtherPos)
+const cChannel *GetChannelByID(const tChannelID & channelID, bool searchOtherPos)
{
- cChannel *VC = Channels.GetByChannelID(channelID, true);
+#if APIVERSNUM >= 20300
+ LOCK_CHANNELS_READ;
+ const cChannel *VC = Channels->GetByChannelID(channelID, true);
+#else
+ const cChannel *VC = Channels.GetByChannelID(channelID, true);
+#endif
if(!VC && searchOtherPos){
//look on other satpositions
for(int i = 0;i < NumberOfAvailableSources;i++){
- channelID = tChannelID(AvailableSources[i], channelID.Nid(), channelID.Tid(), channelID.Sid());
- VC = Channels.GetByChannelID(channelID, true);
+ tChannelID chID = tChannelID(AvailableSources[i], channelID.Nid(), channelID.Tid(), channelID.Sid());
+#if APIVERSNUM >= 20300
+ VC = Channels->GetByChannelID(chID, true);
+#else
+ VC = Channels.GetByChannelID(chID, true);
+#endif
if(VC){
//found this actually on satellite nextdoor...
break;
@@ -159,7 +168,7 @@ private:
cTimeMs LastHandleEvent;
std::map<tChannelID,cList<cEvent>*,tChannelIDCompare> *map_list;
// enum { INSERT_TIMEOUT_IN_MS = 10000 };
- void MergeEquivalents(cEvent* dest, cEvent* src);
+ void MergeEquivalents(cEvent* dest, const cEvent* src);
protected:
virtual void Action(void);
public:
@@ -189,14 +198,19 @@ void cAddEventThread::Action(void)
while (Running() && !LastHandleEvent.TimedOut()) {
std::map<tChannelID, cList<cEvent>*, tChannelIDCompare>::iterator it;
+#if APIVERSNUM >= 20300
+ LOCK_SCHEDULES_WRITE;
+ cSchedules *schedules = Schedules;
+#else
cSchedulesLock SchedulesLock(true, 10);
- cSchedules *schedules = (cSchedules *) cSchedules::Schedules(SchedulesLock);
- Lock();
+ cSchedules *schedules = (cSchedules*)(cSchedules::Schedules(SchedulesLock));
+#endif
+ Lock();
it = map_list->begin();
while (schedules && it != map_list->end()) {
cSchedule *schedule = (cSchedule *) schedules->GetSchedule(
- Channels.GetByChannelID((*it).first), true);
+ GetChannelByID((*it).first, false), true);
while (((*it).second->First()) != NULL) {
cEvent* event = (*it).second->First();
@@ -207,7 +221,7 @@ void cAddEventThread::Action(void)
(*it).second->Del(event, false);
- for (cEvent *ev = schedule->Events()->First(); ev; ev = schedule->Events()->Next(ev)) {
+ for (const cEvent *ev = schedule->Events()->First(); ev; ev = schedule->Events()->Next(ev)) {
if (ev->StartTime() > event->EndTime()) {
break;
}
@@ -215,7 +229,7 @@ void cAddEventThread::Action(void)
&& ((event->StartTime() >= ev->StartTime() && event->StartTime() < ev->EndTime())
|| (ev->StartTime() >= event->StartTime() && ev->StartTime() < event->EndTime()))){
MergeEquivalents(event, ev);
- schedule->DelEvent(ev);
+ schedule->DelEvent((cEvent*)ev);
break;
}
}
@@ -268,7 +282,7 @@ string ExtractAttributes(string text) {
}
-inline void cAddEventThread::MergeEquivalents(cEvent* dest, cEvent* src)
+inline void cAddEventThread::MergeEquivalents(cEvent* dest, const cEvent* src)
{
if (!dest->ShortText() || !strcmp(dest->ShortText(),""))
dest->SetShortText(src->ShortText());
@@ -427,12 +441,16 @@ void sortSchedules(cSchedules * Schedules, tChannelID channelID){
LogD(3, prep("Start sortEquivalent %s"), *channelID.ToString());
- cChannel *pChannel = GetChannelByID (channelID, false);
+ const cChannel *pChannel = GetChannelByID (channelID, false);
cSchedule *pSchedule;
if (pChannel) {
pSchedule = (cSchedule *) (Schedules->GetSchedule(pChannel, true));
pSchedule->Sort();
+#if APIVERSNUM >= 20300
+ pSchedule->SetModified();
+#else
Schedules->SetModified(pSchedule);
+#endif
}
if (EquivHandler->getEquiChanMap().count(*channelID.ToString()) > 0)
EquivHandler->sortEquivalents(channelID, Schedules);
diff --git a/util.h b/util.h
index b72aaa1..7573744 100644
--- a/util.h
+++ b/util.h
@@ -61,7 +61,7 @@ extern cEquivHandler* EquivHandler;
void AddEvent(cEvent *event, tChannelID ChannelID);
-cChannel *GetChannelByID(tChannelID & channelID, bool searchOtherPos);
+const cChannel *GetChannelByID(const tChannelID & channelID, bool searchOtherPos);
time_t LocalTime2UTC(time_t t);
time_t UTC2LocalTime(time_t t);
void GetLocalTimeOffset(void);