sectionsd: retry getting eit_version

Sometimes at first start, the cn thread does not fetch the EIT version
and thus automatic updates don't work. The cause of this is not 100%
clear, for now let's add a workaround to try a bit longer fetching it.

Signed-off-by: Jacek Jendrzej <crashdvb@googlemail.com>


Origin commit data
------------------
Branch: ni/coolstream
Commit: a0cefea55a
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-02-17 (Sun, 17 Feb 2013)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2013-02-17 17:36:19 +01:00
committed by Jacek Jendrzej
parent 01982a3c4a
commit 1e9d977728
2 changed files with 21 additions and 0 deletions

View File

@@ -244,6 +244,7 @@ class CCNThread : public CEventsThread
private: private:
/* overloaded hooks */ /* overloaded hooks */
void addFilters(); void addFilters();
bool shouldSleep();
void beforeSleep(); void beforeSleep();
void beforeWait(); void beforeWait();
void afterWait(); void afterWait();
@@ -254,6 +255,7 @@ class CCNThread : public CEventsThread
OpenThreads::Mutex update_mutex; OpenThreads::Mutex update_mutex;
bool updating; bool updating;
cDemux * eitDmx; cDemux * eitDmx;
int eit_retry;
void sendCNEvent(); void sendCNEvent();
public: public:

View File

@@ -1575,6 +1575,23 @@ bool CEventsThread::addEvents()
return true; return true;
} }
bool CCNThread::shouldSleep()
{
if (!scanning || channel_is_blacklisted)
return true;
if (!sendToSleepNow)
return false;
if (eit_version != 0xff)
return true;
if (++eit_retry > 1) {
xprintf("%s::%s eit_retry > 1 (%d) -> going to sleep\n", name.c_str(), __func__, eit_retry);
return true;
}
sendToSleepNow = false;
return false;
}
/* default check if thread should go to sleep */ /* default check if thread should go to sleep */
bool CEventsThread::shouldSleep() bool CEventsThread::shouldSleep()
{ {
@@ -1648,6 +1665,7 @@ CCNThread::CCNThread()
updating = false; updating = false;
eitDmx = new cDemux(0); eitDmx = new cDemux(0);
eit_retry = 0;
} }
/* CN thread hooks */ /* CN thread hooks */
@@ -1713,6 +1731,7 @@ void CCNThread::beforeSleep()
/* send a "no epg" event anyway before going to sleep */ /* send a "no epg" event anyway before going to sleep */
sendCNEvent(); sendCNEvent();
} }
eit_retry = 0;
} }
void CCNThread::processSection() void CCNThread::processSection()