diff --git a/src/eitd/eitd.h b/src/eitd/eitd.h index 31858afe2..e0aead9c3 100644 --- a/src/eitd/eitd.h +++ b/src/eitd/eitd.h @@ -244,6 +244,7 @@ class CCNThread : public CEventsThread private: /* overloaded hooks */ void addFilters(); + bool shouldSleep(); void beforeSleep(); void beforeWait(); void afterWait(); @@ -254,6 +255,7 @@ class CCNThread : public CEventsThread OpenThreads::Mutex update_mutex; bool updating; cDemux * eitDmx; + int eit_retry; void sendCNEvent(); public: diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index e2c45bf76..3344aa424 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1599,6 +1599,23 @@ bool CEventsThread::addEvents() 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 */ bool CEventsThread::shouldSleep() { @@ -1672,6 +1689,7 @@ CCNThread::CCNThread() updating = false; eitDmx = new cDemux(0); + eit_retry = 0; } /* CN thread hooks */ @@ -1737,6 +1755,7 @@ void CCNThread::beforeSleep() /* send a "no epg" event anyway before going to sleep */ sendCNEvent(); } + eit_retry = 0; } void CCNThread::processSection()