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.
This commit is contained in:
Stefan Seyfried
2013-02-17 17:36:19 +01:00
parent 2f6ad23f78
commit 987dffdb87
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

@@ -1599,6 +1599,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()
{ {
@@ -1672,6 +1689,7 @@ CCNThread::CCNThread()
updating = false; updating = false;
eitDmx = new cDemux(0); eitDmx = new cDemux(0);
eit_retry = 0;
} }
/* CN thread hooks */ /* CN thread hooks */
@@ -1737,6 +1755,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()