summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--README1
-rw-r--r--eepg.c19
-rw-r--r--eit2.c7
-rw-r--r--eit2.h8
-rw-r--r--epghandler.c4
-rw-r--r--util.c1
-rw-r--r--util.h4
8 files changed, 32 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index b07b767..320a63e 100644
--- a/Makefile
+++ b/Makefile
@@ -102,11 +102,15 @@ OBJS = $(PLUGIN).o dish.o epghandler.o setupeepg.o equivhandler.o util.o eit2.o
### The main target:
+<<<<<<< HEAD
ifdef API1733
all: libvdr-$(PLUGIN).so i18n
else
all: $(SOFILE) i18n
endif
+=======
+all: $(SOFILE)
+>>>>>>> master
### Implicit rules:
diff --git a/README b/README
index ea59f58..b04c44f 100644
--- a/README
+++ b/README
@@ -124,6 +124,7 @@ This code is based on:
* cAddEventThread from EPGFixer plugin by Matti Lehtimaki matti.lehtimaki /at/ gmail.com
Thanks to mrgandalf, and the others who helped map NA eit.
Thanks to VDR User for testing and providing makequiv.sh script for S72.7W channels.
+Thanks to cheesemonster for providing a patch to fix multipe device problems
We wish to thank all authors for the great work they have been doing, decoding
this EEPG data; this plugin tries to combine the best of all worlds.
diff --git a/eepg.c b/eepg.c
index 10e966e..f55f9ed 100644
--- a/eepg.c
+++ b/eepg.c
@@ -193,7 +193,7 @@ private:
bool EndChannels, EndThemes; //only used for ??
int MHWStartTime; //only used for MHW1
bool ChannelsOk;
- //int Format; //the format that this filter currently is processing
+ EFormat Format; //the format that this filter currently is processing
std::map < int, int >ChannelSeq; // ChannelSeq[ChannelId] returns the recordnumber of the channel
Summary_t *Summaries[MAX_TITLES];
@@ -212,6 +212,8 @@ private:
void NextPmt (void);
void ProccessContinuous(u_short Pid, u_char Tid, int Length, const u_char *Data);
+ bool load_sky_file (const char *filename);
+ int sky_huffman_decode (const u_char * Data, int Length, unsigned char *DecodeText);
protected:
virtual void Process (u_short Pid, u_char Tid, const u_char * Data, int Length);
virtual void AddFilter (u_short Pid, u_char Tid);
@@ -276,7 +278,7 @@ void cFilterEEPG::SetStatus (bool On)
if (!On) {
FreeSummaries ();
FreeTitles ();
- //Format = 0;
+ Format = MHW1;
ChannelsOk = false;
NumberOfTables = 0;
} else {
@@ -423,7 +425,7 @@ static bool load_freesat_file (int tableid, const char *filename)
* \param filename - Filename to load
* \return Success of operation
*/
-static bool load_sky_file (const char *filename)
+bool cFilterEEPG::load_sky_file (const char *filename)
{
FILE *FileDict;
char *Line;
@@ -716,7 +718,7 @@ char *freesat_huffman_decode (const unsigned char *src, size_t size)
return NULL;
}
-int sky_huffman_decode (const u_char * Data, int Length, unsigned char *DecodeText)
+int cFilterEEPG::sky_huffman_decode (const u_char * Data, int Length, unsigned char *DecodeText)
{
sNodeH *nH, H=(Format==SKY_IT)?*sky_tables[0]:*sky_tables[1];
int i;
@@ -887,8 +889,13 @@ bool cFilterEEPG::GetThemesSKYBOX (void) //TODO can't we read this from the DVB
* \brief Initialize the Huffman dictionaries if they are not already initialized.
*
*/
+static cMutex InitDictionary_mutex;
+
bool cFilterEEPG::InitDictionary (void)
{
+ // This function must be serialised because it updates sky_tables and tables
+ // which are both globals.
+ cMutexLock MutexLock(&InitDictionary_mutex);
string FileName = cSetupEEPG::getInstance()->getConfDir();
switch (Format) {
case SKY_IT:
@@ -2906,7 +2913,7 @@ void cFilterEEPG::ProccessContinuous(u_short Pid, u_char Tid, int Length, const
cSchedules *Schedules = (cSchedules*)(cSchedules::Schedules(SchedulesLock));
//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, Pid == EIT_PID);
+ SI::cEIT2 EIT(Schedules, Source(), Tid, Data, Format, Pid == EIT_PID);
else//cEIT EIT (Schedules, Source (), Tid, Data);
{
@@ -2917,7 +2924,7 @@ void cFilterEEPG::ProccessContinuous(u_short Pid, u_char Tid, int Length, const
cSchedulesLock SchedulesLock;
cSchedules *Schedules = (cSchedules*)(cSchedules::Schedules(SchedulesLock));
if(Schedules)
- SI::cEIT2 EIT(Schedules, Source(), Tid, Data, Pid == EIT_PID, true);
+ SI::cEIT2 EIT(Schedules, Source(), Tid, Data, Format, Pid == EIT_PID, true);
//cEIT EIT (Schedules, Source (), Tid, Data, true);
}
diff --git a/eit2.c b/eit2.c
index 3980dba..4e813af 100644
--- a/eit2.c
+++ b/eit2.c
@@ -9,7 +9,6 @@
#include <string>
#include <vdr/config.h>
#include "log.h"
-#include "util.h"
#include "dish.h"
#include "equivhandler.h"
@@ -435,10 +434,11 @@ void cEIT2::ProcessEventDescriptors(bool ExternalData, int Source,
channel->SetLinkChannels (LinkChannels);
}
-cEIT2::cEIT2 (cSchedules * Schedules, int Source, u_char Tid, const u_char * Data, bool isEITPid, bool OnlyRunningStatus)
+cEIT2::cEIT2 (cSchedules * Schedules, int Source, u_char Tid, const u_char * Data, EFormat format, bool isEITPid, bool OnlyRunningStatus)
: SI::EIT (Data, false)
, OnlyRunningStatus(OnlyRunningStatus)
, Schedules(Schedules)
+, Format(format)
{
//LogD(2, prep("cEIT2::cEIT2"));
@@ -563,13 +563,14 @@ cEIT2::cEIT2 (cSchedules * Schedules, int Source, u_char Tid, const u_char * Dat
}
//end of cEIT2
-cEIT2::cEIT2 (cSchedule * Schedule)
+cEIT2::cEIT2 (cSchedule * Schedule, EFormat format)
: Empty(true)
, Modified(false)
, OnlyRunningStatus(false)
, SegmentStart(0)
, SegmentEnd(0)
, Schedules(NULL)
+, Format(format)
{
//LogD(2, prep("cEIT2::cEIT2"));
// if (Tid > 0 && (Format == DISH_BEV || (SetupPE->ProcessEIT && isEITPid))) Tid--;
diff --git a/eit2.h b/eit2.h
index c6251fe..0cfd6e6 100644
--- a/eit2.h
+++ b/eit2.h
@@ -4,7 +4,9 @@
#include <libsi/descriptor.h>
#include <libsi/si.h>
#include <vdr/epg.h>
+#include "util.h"
+using namespace util;
namespace SI
{
@@ -49,9 +51,10 @@ extern bool SystemCharacterTableIsSingleByte;*/
class cEIT2:public SI::EIT
{
public:
- cEIT2(cSchedules * Schedules, int Source, u_char Tid, const u_char * Data, bool isEITPid = false,
+ cEIT2(cSchedules * Schedules, int Source, u_char Tid, const u_char * Data,
+ EFormat format, bool isEITPid = false,
bool OnlyRunningStatus = false);
- cEIT2 (cSchedule * Schedule);
+ cEIT2 (cSchedule * Schedule, EFormat format);
//protected:
// void updateEquivalent(cSchedules * Schedules, tChannelID channelID, cEvent *pEvent);
cEvent* ProcessEitEvent(cSchedule *Schedule, const SI::EIT::Event *EitEvent, uchar TableID, uchar Version);
@@ -69,6 +72,7 @@ private:
time_t SegmentStart;
time_t SegmentEnd;
cSchedules* Schedules;
+ EFormat Format;
cChannel* channel;
};
diff --git a/epghandler.c b/epghandler.c
index 8302cdc..f7a5598 100644
--- a/epghandler.c
+++ b/epghandler.c
@@ -41,9 +41,9 @@ bool cEEpgHandler::HandleEitEvent(cSchedule* Schedule,
int nid = schedule->ChannelID().Nid();
if ((nid >= 0x1001 && nid <= 0x100B) || nid == 0x101 || nid == 0x100) {
//Set the Format for Eit events so that the new lines are not erased with FixEpgBugs
- if (Format != DISH_BEV) Format = DISH_BEV;
+ EFormat Format = DISH_BEV;
- SI::cEIT2 eit2(Schedule);
+ SI::cEIT2 eit2(Schedule, Format);
eit2.ProcessEitEvent(Schedule, EitEvent, TableID, Version);
return true;
}
diff --git a/util.c b/util.c
index 96a80fd..0373d1a 100644
--- a/util.c
+++ b/util.c
@@ -28,7 +28,6 @@ struct hufftab *tables[2][128];
int table_size[2][128];
map<string,string> tableDict;
-EFormat Format;
cEquivHandler* EquivHandler;
cChannel *GetChannelByID(tChannelID & channelID, bool searchOtherPos)
diff --git a/util.h b/util.h
index 2a4cd51..b72aaa1 100644
--- a/util.h
+++ b/util.h
@@ -40,7 +40,7 @@ extern int Yesterday;
extern int YesterdayEpoch;
extern int YesterdayEpochUTC;
-extern enum EFormat
+enum EFormat
{
//First all batchmode, load ONCE protocols:
MHW1 = 0,
@@ -55,7 +55,7 @@ extern enum EFormat
EIT,
//the highest number of EPG-formats that is supported by this plugin
HIGHEST_FORMAT = EIT
-} Format;
+};
extern cEquivHandler* EquivHandler;