summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--eepg.c28
-rw-r--r--epghandler.c23
-rw-r--r--equivhandler.c5
4 files changed, 19 insertions, 40 deletions
diff --git a/README b/README
index edde5b7..28060c8 100644
--- a/README
+++ b/README
@@ -129,7 +129,4 @@ information.
KNOWN BUGS
-Equivalents file is not used for Premiere.
--On Sky Italy and Sky UK, a lot of "summaries not found" are reported. This is
- because it is not (yet) known where the "summary available" flag is coded in the
- OpenTV protocol used, so all titles are assumed to have a summary available.
diff --git a/eepg.c b/eepg.c
index 0c6e606..01257fa 100644
--- a/eepg.c
+++ b/eepg.c
@@ -219,7 +219,7 @@ protected:
virtual bool GetThemesSKYBOX (void);
virtual int GetTitlesSKYBOX (const u_char * Data, int Length);
virtual int GetSummariesSKYBOX (const u_char * Data, int Length);
- virtual int GetChannelsMHW (const u_char * Data, int Length, int MHW); //TODO replace MHW by Format?
+ virtual int GetChannelsMHW (const u_char * Data, int Length);
virtual int GetThemesMHW1 (const u_char * Data, int Length);
virtual int GetNagra (const u_char * Data, int Length);
virtual void ProcessNagra (void);
@@ -831,18 +831,20 @@ bool cFilterEEPG::InitDictionary (void)
*
* \return 0 = fatal error, code 1 = success, code 2 = last item processed
*/
-int cFilterEEPG::GetChannelsMHW (const u_char * Data, int Length, int MHW)
+int cFilterEEPG::GetChannelsMHW (const u_char * Data, int Length)
{
- if ((MHW == 1) || (nChannels == 0)) { //prevents MHW2 from reading channels twice while waiting for themes on same filter
+ if (Format != MHW1 && Format != MHW2) return 0;
+
+ if ((Format == MHW1) || (nChannels == 0)) { //prevents MHW2 from reading channels twice while waiting for themes on same filter
sChannelMHW1 *Channel;
int Size, Off;
Size = sizeof (sChannelMHW1);
Off = 4;
- if (MHW == 1) {
+ if (Format == MHW1) {
//Channel = (sChannelMHW1 *) (Data + 4);
nChannels = (Length - Off) / sizeof (sChannelMHW1);
}
- if (MHW == 2) {
+ if (Format == MHW2) {
if (Length > 120)
nChannels = Data[120];
else {
@@ -874,7 +876,7 @@ int cFilterEEPG::GetChannelsMHW (const u_char * Data, int Length, int MHW)
C->ChannelId = i;
ChannelSeq[C->ChannelId] = i; //fill lookup table to go from channel-id to sequence nr in table
C->SkyNumber = 0;
- if (MHW == 1)
+ if (Format == MHW1)
memcpy (C->Name, &Channel->Name, 16); //MHW1
else { //MHW2
int lenName = Data[pName] & 0x0f;
@@ -935,13 +937,15 @@ int cFilterEEPG::GetThemesMHW1 (const u_char * Data, int Length)
const u_char *ThemesIndex = (Data + 3);
for (int i = 0; i < nThemes; i++) {
if (ThemesIndex[ThemeId] == i) {
- Offset = (Offset + 15) & 0xf0; //TODO do not understand this
+ //The index of the Themes in MHW1 is not incremented by 1 but with offset calculated like this
+ Offset = (Offset + 15) & 0xf0;
ThemeId++;
}
memcpy (&Themes[Offset][0], &Theme->Name, 15);
Themes[Offset][15] = '\0'; //trailing null
CleanString (Themes[Offset]);
- LogI(1, prep("%.15s"), Themes[Offset]);
+// LogI(1, prep("%.15s"), Themes[Offset]);
+ LogI(1, prep("%.15s|Offset:%06d"), Themes[Offset],Offset);
Offset++;
Theme++;
}
@@ -2585,7 +2589,7 @@ void cFilterEEPG::LoadIntoSchedule (void)
if (SummariesNotFound)
if (nTitles-nSummaries!=SummariesNotFound) {
esyslog ("EEPG: %i summaries not found", SummariesNotFound);
- esyslog ("EEPG: %i difference between no of summaries and summaries not found", nTitles-nSummaries-SummariesNotFound);
+ esyslog ("EEPG: %i difference between No. of summaries and summaries not found", nTitles-nSummaries-SummariesNotFound);
} else
isyslog ("EEPG: %i titles without summaries", SummariesNotFound);
if (OldEvents)
@@ -2706,6 +2710,7 @@ void cFilterEEPG::ProcessNextFormat (bool FirstTime = false)
break;
case SKY_IT:
case SKY_UK:
+ GetThemesSKYBOX (); //Sky Themes from file
AddFilter (0x11, SI::TableIdSKYChannels); //Sky Channels
break;
case FREEVIEW: //Freeview, CONT mode //TODO streamline this for other modes
@@ -2997,7 +3002,7 @@ void cFilterEEPG::Process (u_short Pid, u_char Tid, const u_char * Data, int Len
EndThemes = true; //also set Endthemes on true on fatal error
} //if Data
else if (Data[3] == 0x00) { //Channels it will be
- Result = GetChannelsMHW (Data, Length, 2); //return code 0 = fatal error, code 1 = success, code 2 = last item processed
+ Result = GetChannelsMHW (Data, Length); //return code 0 = fatal error, code 1 = success, code 2 = last item processed
if (Result != 1)
EndChannels = true; //always remove filter, code 1 should never be returned since MHW2 always reads all channels..
ChannelsOk = (Result == 2);
@@ -3014,7 +3019,7 @@ void cFilterEEPG::Process (u_short Pid, u_char Tid, const u_char * Data, int Len
} //if Pid == 0x231
break;
case SI::TableIdMHW1Channels:
- Result = GetChannelsMHW (Data, Length, 1); //return code 0 = fatal error, code 1 = success, code 2 = last item processed
+ Result = GetChannelsMHW (Data, Length); //return code 0 = fatal error, code 1 = success, code 2 = last item processed
Del (Pid, Tid); //always remove filter, code 1 should never be returned since MHW1 always reads all channels...
if (Result == 2)
AddFilter (0xd2, SI::TableIdMHW1TitlesSummaries); //TitlesMHW1
@@ -3068,7 +3073,6 @@ void cFilterEEPG::Process (u_short Pid, u_char Tid, const u_char * Data, int Len
if (Result != 1) //only breakoff on completion or error; do NOT clean up after success, because then not all bouquets will be read
Del (Pid, Tid); //Read all channels, clean up filter
if (Result == 2) {
- GetThemesSKYBOX (); //Sky Themes from file; must be called AFTER first channels to have lThemes initialized FIXME
if (InitDictionary ())
AddFilter (0x30, SI::TableIdSKYTitlesA0, 0xfc); //SKY Titles batch 0 of 7
else {
diff --git a/epghandler.c b/epghandler.c
index f7c821d..328aa91 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -61,27 +61,6 @@ bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule,
}
modified = false;
-// //VDR creates new event if the EitEvent StartTime is different than EEPG time so
-// //the EPG event has to be deleted but the data should be kept
-// const cEvent* ev = schedule->GetEvent(EitEvent->getEventId(),EitEvent->getStartTime());
-// if (!ev){
-// ev = schedule->GetEvent(EitEvent->getEventId());
-// if (ev && ((ev->StartTime()>EitEvent->getStartTime() && ev->StartTime()<=EitEvent->getStartTime()+EitEvent->getDuration())
-// || (EitEvent->getStartTime() > ev->StartTime() && EitEvent->getStartTime() <= ev->EndTime()))) {
-// LogD(0, prep("!!!Deleting Event id:%d title:%s start_time:%d new_start_time:%d duration:%d new_duration:%d"), ev->EventID(), ev->Title(), ev->StartTime(), EitEvent->getStartTime(), ev->Duration(), EitEvent->getDuration());
-//
-// if (ev->Description() && strcmp(ev->Description(),"") != 0)
-// origDescription = ev->Description();
-// if (ev->ShortText() && strcmp(ev->ShortText(),"") != 0)
-// origShortText = ev->ShortText();
-// schedule->DelEvent((cEvent *) ev);
-//// Schedule->DropOutdated(ev->StartTime()-1,ev->EndTime()+1,ev->TableID()-1,ev->Version());
-// LogD(0, prep("!!!End Deleting Event"));
-// //TODO equivalent channels !!!
-// }
-// }
-
-
return false;
// return true;
@@ -116,7 +95,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());
- schedule->DelEvent((cEvent*) eqEvent);
+ schedule->DelEvent((cEvent*) eqEvent);//The equivalents should be handled on adding equivalent event.
}
}
}
diff --git a/equivhandler.c b/equivhandler.c
index 281d2f3..1d313db 100644
--- a/equivhandler.c
+++ b/equivhandler.c
@@ -24,7 +24,6 @@ cEquivHandler::cEquivHandler()
cEquivHandler::~cEquivHandler()
{
- // TODO Auto-generated destructor stub
}
void cEquivHandler::loadEquivalentChannelMap (void)
@@ -78,7 +77,7 @@ void cEquivHandler::loadEquivalentChannelMap (void)
//int i = 0;
cChannel *OriginalChannel = Channels.GetByChannelID (OriginalChID, false);
if (!OriginalChannel) {
- LogI(2, prep("Warning, not found epg channel \'%s\' in channels.conf. Equivalency is assumed to be valid, but perhaps you should check the entry in the equivalents file"), origChanID); //TODO: skip this ing?
+ 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;
}
if (sscanf (equiChanID, "%[^-]-%i -%i -%i ", source, &nid, &tid, &sid) == 4) {
@@ -87,7 +86,7 @@ void cEquivHandler::loadEquivalentChannelMap (void)
rid = 0;
}
tChannelID EquivChID = tChannelID (cSource::FromString (source), nid, tid, sid, rid);
- cChannel *EquivChannel = Channels.GetByChannelID (EquivChID, false); //TODO use valid function?
+ cChannel *EquivChannel = Channels.GetByChannelID (EquivChID, false);
if (EquivChannel) {
ret = equiChanMap.equal_range(*OriginalChID.ToString());
for (it=ret.first; it!=ret.second; ++it)