From 6dd137c768b7bd84b6e5524d46d3fd6b5df53f30 Mon Sep 17 00:00:00 2001
From: Karl Dietz <dekarl@users.sourceforge.net>
Date: Fri, 23 Mar 2012 10:10:50 +0100
Subject: [PATCH 5/6] fix Failed CRC check 0xVARIABLE != 0xVARIABLE for StreamID = 0x80-0x8f
PSIPTable::HasCRC defaults everything 0x80-0xfe to true due to Dishnet.
But the real CA_message_section doesn't have a CRC.
This should fix ECM/EMM spamming the logs with false errors.
Disable crc checking for Dishnet for the time being
---
mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp | 2 +-
mythtv/libs/libmythtv/mpeg/mpegtables.cpp | 13 +++++++++++--
mythtv/libs/libmythtv/mpeg/mpegtables.h | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp b/mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
index 43bcbe8..7f1d2a3 100644
a
|
b
|
void MPEGStreamData::HandleTSTables(const TSPacket* tspacket) |
931 | 931 | DONE_WITH_PSIP_PACKET(); |
932 | 932 | } |
933 | 933 | |
934 | | // Don't do validation on tables withotu CRC |
| 934 | // Don't do validation on tables without CRC |
935 | 935 | if (!psip->HasCRC()) |
936 | 936 | { |
937 | 937 | HandleTables(tspacket->PID(), *psip); |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegtables.cpp b/mythtv/libs/libmythtv/mpeg/mpegtables.cpp
index 39ce59c..92a1e90 100644
a
|
b
|
uint StreamID::Normalize(uint stream_id, const desc_list_t &desc, |
77 | 77 | |
78 | 78 | bool PSIPTable::HasCRC(void) const |
79 | 79 | { |
| 80 | // default is false, but gets set to true for 0x80-0xfe at the end! |
80 | 81 | bool has_crc = false; |
81 | 82 | |
82 | 83 | switch (TableID()) |
… |
… |
bool PSIPTable::HasCRC(void) const |
169 | 170 | has_crc = true; |
170 | 171 | } |
171 | 172 | |
172 | | // Dishnet Longterm EIT data |
| 173 | // FIXME Dishnet Longterm EIT data, only on PID 0x300! Forces table_id 0x80-0xef to true unless handled before or after! |
173 | 174 | if (TableID::DN_EITbego <= TableID() && |
174 | 175 | TableID() <= TableID::DN_EITendo) |
175 | 176 | { |
176 | | has_crc = true; |
| 177 | // FIXME disable until I know how to filter on PID 0x300 / Dishnet |
| 178 | // has_crc = true; |
| 179 | } |
| 180 | |
| 181 | // ATSC/DVB conditional access ECM/EMM, reset to false after Dishnet |
| 182 | if (TableID::ECM0 <= TableID() && |
| 183 | TableID() <= TableID::ECMend) |
| 184 | { |
| 185 | has_crc = false; |
177 | 186 | } |
178 | 187 | } |
179 | 188 | break; |
diff --git a/mythtv/libs/libmythtv/mpeg/mpegtables.h b/mythtv/libs/libmythtv/mpeg/mpegtables.h
index 053dd1e..a564463 100644
a
|
b
|
class MTV_PUBLIC TableID |
305 | 305 | SITscte = 0xFC, // SCTE 35 Splice Info Table (Cueing messages) |
306 | 306 | |
307 | 307 | // ATSC Conditional Access (A/70) |
| 308 | // DVB Conditional Access (TS 100 289) |
308 | 309 | ECM0 = 0x80, |
309 | 310 | ECM1 = 0x81, |
310 | 311 | ECMbeg = 0x82, // ECM begin private data |