summaryrefslogtreecommitdiff
path: root/eepg.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2014-04-14 07:51:17 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2014-04-14 07:51:17 (GMT)
commit970976d2758c659dc41ffabf9bc9b160c8fbc29b (patch)
treed9563c8e4d5018dae924b4b1355933b668c9b951 /eepg.c
parent4e51e3a4c2b3006f8ce760ebcdc424b9c7a3eeb4 (diff)
parentd7dc6141c91b48c410e9cc5734ca9a2adecc278e (diff)
downloadvdr-plugin-eepg-970976d2758c659dc41ffabf9bc9b160c8fbc29b.tar.gz
vdr-plugin-eepg-970976d2758c659dc41ffabf9bc9b160c8fbc29b.tar.bz2
Merge branch 'master' into experimental
Diffstat (limited to 'eepg.c')
-rw-r--r--eepg.c19
1 files changed, 13 insertions, 6 deletions
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);
}