aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2010-12-02 17:58:15 +0100
committerghost <andreas.monzner@multimedia-labs.de>2010-12-02 17:58:15 +0100
commit654e9f170ac0db764a865f41983c925269d5c188 (patch)
tree68038bdb652ced15d9430a90d16cf5db30057d41 /lib/dvb
parent356d37043cbe1265a83c985e2cef7185daf74cb9 (diff)
downloadenigma2-654e9f170ac0db764a865f41983c925269d5c188.tar.gz
enigma2-654e9f170ac0db764a865f41983c925269d5c188.zip
lib/dvb/esection.h: add handling for broken table version handling
Diffstat (limited to 'lib/dvb')
-rw-r--r--lib/dvb/esection.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/dvb/esection.h b/lib/dvb/esection.h
index 2bb17a98..b4782f81 100644
--- a/lib/dvb/esection.h
+++ b/lib/dvb/esection.h
@@ -100,6 +100,10 @@ class eAUTable: public eAUGTable
int first;
ePtr<iDVBDemux> m_demux;
eMainloop *ml;
+
+ /* needed to detect broken table version handling (seen on some m2ts files) */
+ struct timespec m_prev_table_update;
+ int m_table_cnt;
public:
eAUTable()
@@ -119,6 +123,7 @@ public:
int begin(eMainloop *m, const eDVBTableSpec &spec, ePtr<iDVBDemux> demux)
{
+ m_table_cnt = 0;
ml = m;
m_demux = demux;
first= 1;
@@ -197,6 +202,24 @@ public:
if (current && (!current->getSpec(spec)))
{
+ /* detect broken table version handling (seen on some m2ts files) */
+ if (m_table_cnt)
+ {
+ if (abs(timeout_usec(m_prev_table_update)) > 500000)
+ m_table_cnt = -1;
+ else if (m_table_cnt > 1) // two pmt update within one second
+ {
+ eDebug("Seen two consecutive table version changes within 500ms. "
+ "This seems broken, so auto update for pid %04x, table %02x is now disabled!!",
+ spec.pid, spec.tid);
+ m_table_cnt = 0;
+ return;
+ }
+ }
+
+ ++m_table_cnt;
+ clock_gettime(CLOCK_MONOTONIC, &m_prev_table_update);
+
next = new Table();
CONNECT(next->tableReady, eAUTable::slotTableReady);
spec.flags &= ~(eDVBTableSpec::tfAnyVersion|eDVBTableSpec::tfThisVersion|eDVBTableSpec::tfHaveTimeout);