sectionsd: try to improve cnthread update filter logic

Origin commit data
------------------
Branch: ni/coolstream
Commit: 0bc1ad6abb
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2016-01-24 (Sun, 24 Jan 2016)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2016-01-24 11:44:10 +01:00
parent b95452b3bd
commit 0e475c8ddf

View File

@@ -1719,10 +1719,21 @@ bool CCNThread::shouldSleep()
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);
/* on first retry, restart the demux. I'm not sure if it is a driver bug
* or a bug in our logic, but without this, I'm sometimes missing CN events
* and / or the eit_version and thus the update filter will stop working */
if (++eit_retry < 2) {
xprintf("%s::%s first retry (%d) -> restart demux\n", name.c_str(), __func__, eit_retry);
change(0); /* this also resets lastChanged */
}
/* ugly, this has been checked before. But timeoutsDMX can be < 0 for multiple reasons,
* and only skipTime should send CNThread finally to sleep if eit_version is not found */
time_t since = time_monotonic() - lastChanged;
if (since > skipTime) {
xprintf("%s::%s timed out after %lds -> going to sleep\n", name.c_str(), __func__, since);
return true;
}
/* retry */
sendToSleepNow = false;
return false;
}