From fddfe7581dc85bf74bae1aa7d12304acd941f351 Mon Sep 17 00:00:00 2001 From: Dimitar Petrovski Date: Tue, 20 Nov 2012 18:58:11 +0100 Subject: new way of fixing of charset without patching VDR, unfortunately this makes two more conversions handle some more duplicate events in the event handler extract category and genre when needed --- eepg.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'eepg.c') diff --git a/eepg.c b/eepg.c index 7060168..0c4608c 100644 --- a/eepg.c +++ b/eepg.c @@ -189,7 +189,6 @@ private: bool EndChannels, EndThemes; //only used for ?? int MHWStartTime; //only used for MHW1 bool ChannelsOk; - int prevNid; //int Format; //the format that this filter currently is processing std::map < int, int >ChannelSeq; // ChannelSeq[ChannelId] returns the recordnumber of the channel @@ -255,7 +254,6 @@ cFilterEEPG::cFilterEEPG (void) { nSummaries = 0; nTitles = 0; - prevNid = 0; Trigger (); //Set (0x00, 0x00); } @@ -282,7 +280,7 @@ void cFilterEEPG::SetStatus (bool On) for (int i = 0; i <= HIGHEST_FORMAT; i++) UnprocessedFormat[i] = 0; //pid 0 is assumed to be nonvalid for EEPG transfers AddFilter (0, 0); - int nid = Channel()->Nid(); +/* int nid = Channel()->Nid(); if (nid != prevNid) { if (nid == 0x01 && prevNid != 0x01) { setenv("VDR_CHARSET_OVERRIDE", "ISO-8859-9", true); @@ -293,6 +291,7 @@ void cFilterEEPG::SetStatus (bool On) } prevNid = nid; } + */ } cFilter::SetStatus (On); Trigger (); @@ -1322,7 +1321,6 @@ void cFilterEEPG::WriteToSchedule(tChannelID channelID, cSchedules* pSchedules, string tmpTitle(Text); if (Format == MHW2 && !shText.empty()) { - //TODO (HD) channels size_t found = tmpTitle.find(" (HD)"); if (found != string::npos) tmpTitle.erase(found, 5); @@ -1331,10 +1329,15 @@ void cFilterEEPG::WriteToSchedule(tChannelID channelID, cSchedules* pSchedules, shText.erase(0, tmpTitle.size() + 2); } - //Do not use Subtitle if it is substring of Title + //Do not use Subtitle if it is substring of Title if (tmpTitle.compare(0, shText.size(), shText) == 0) shText.clear(); + //The subtitle is wrong if contains '.' + if (Format == SKY_UK && !shText.empty() && shText.find('.') != string::npos) { + shText.clear(); + } + #define MAX_USEFUL_EPISODE_LENGTH 40 // From VDR FixEPG Bugs // Some channels put a whole lot of information in the ShortText and leave @@ -1366,6 +1369,18 @@ void cFilterEEPG::WriteToSchedule(tChannelID channelID, cSchedules* pSchedules, WrittenSummary = true; CleanString ((uchar *) SummText); + //Fix MHW1 formating + if (Format == MHW1) { + char * pch; + pch=strchr(SummText,'s'); + while (pch!=NULL) + { + if (*(pch-1) != ' ' && *(pch-1) != '\n') + *pch = ' '; + pch=strchr(pch+1,'s'); + } + } + //Add themes and categories epgsearch style //TODO DPE move this char *theme; @@ -2070,7 +2085,7 @@ int cFilterEEPG::GetSummariesMHW1 (const u_char * Data, int Length) LogE(0, prep("Summaries memory allocation error.")); return 0; } - Text[SummaryLength+1] = '\0'; //end string with NULL character + //Text[SummaryLength+1] = '\0'; //end string with NULL character //memcpy (Text, &Data[SummaryOffset], SummaryLength); decodeText2(&Data[SummaryOffset], SummaryLength, (char*)Text, 2*SummaryLength + 1); // CleanString (Text); @@ -2083,6 +2098,8 @@ int cFilterEEPG::GetSummariesMHW1 (const u_char * Data, int Length) Summaries[nSummaries] = S; S->NumReplays = Summary->NumReplays; S->EventId = HILO32 (Summary->ProgramId); +// unsigned short SectionLength = ((Summary->SectionLengthHigh & 0x0f) << 8) | Summary->SectionLengthLow; +// Asprintf((char **)&Text, "%s \n\n SecLength:%d SLHigh:%d SLLow:%d", Text, SectionLength, Summary->SectionLengthHigh, Summary->SectionLengthLow); S->Text = Text; S->ShortTextLength = 0; //TODO find for MHW1 int i = 0; -- cgit v1.2.3