[mythtv] [patch] atsctables.cpp assert removal

Daniel Thor Kristjansson danielk at mrl.nyu.edu
Wed Jan 19 22:08:19 EST 2005

]On Wed, 19 Jan 2005, Daniel Thor Kristjansson wrote:
]> On Wed, 19 Jan 2005, Eric Anderson wrote:
]> ]On a different subject, while debugging this code, I hit an assert in the
]> ]atsctables.cpp. I *think* the assert is saying -- "If we see table data for
]> ]NTSC in an ATSC PSIP packet, that doesn't make sense." Well, fine.
]> NTSC data does make sense in the PSIP data. But I'll look at this, you
]> shouldn't be hitting any asserts.
]But when you're receiving data from some other system...  or you're trying
]to debug a piece of hardware, calling assert() when you see some unexpected
]data doesn't necessarily help the debug process all that much.

I've attached a patch that removes the assert. The assert tried to 
assert that the PSIP data was for a channel transmitting in either a 
ATSC or Analog (NTSC/PAL). My guess is that this happened after you 
eliminated the CRC check of PSIP packets. If so, the assert was 
trying to be useful. ;)

The attached patch prints out the modulation mode if it is a known mode, 
or prints out UNKNOWN and the raw data if it is a modulation mode not 
in the current ATSC standard.

[ the text below was the first subject, but it doesn't concern the patch -dtk ]

]> ]Essentially the problem here is that the PES code doesn't compute the CRC
]> ]for multi-packet ETT and EIT tables. In fact, for the program text tables
]> Hmmm, that sounds odd, we compute it for other multi-packet tables. I'll
]> check this.

As I thought, we do compute it for multi-ts-packet pes packets. Please 
note the "AssemblePSIP(tspacket)" at the begining of
ATSCStreamData::HandleTables(). Your patch removes the CRC check for 
these packets.

BTW I'll look at your data to see if I can find the problem.
Try not to spend too much time on this, I'm planning on replacing the 
PESPacket code with the code in Jacob Taylor's patch when it is 
integrated. The current PESPacket only really works for PSIP packets 
while the DVB code handles video and audio data as well.

-- Daniel
-------------- next part --------------
Index: libs/libmythtv/mpeg/atsctables.cpp
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/mpeg/atsctables.cpp,v
retrieving revision 1.2
diff -u -r1.2 atsctables.cpp
--- libs/libmythtv/mpeg/atsctables.cpp	24 Dec 2004 23:24:07 -0000	1.2
+++ libs/libmythtv/mpeg/atsctables.cpp	20 Jan 2005 02:50:50 -0000
@@ -87,12 +87,23 @@
 QString TerrestrialVirtualChannelTable::toString(int chan) const {
+    static QString modnames[6] =
+    {
+        QObject::tr("[Reserved]"),  QObject::tr("Analog"),
+        QObject::tr("SCTE mode 1"), QObject::tr("SCTE mode 2"),
+        QObject::tr("ATSC 8-VSB"),  QObject::tr("ATSC 16-VSB"),
+    };
     QString str;
     str.append(QString("Channel #%1 ").arg(chan));
     str.append(QString("name(%1) %2-%3 ").arg(ShortChannelName(chan)).
-    assert(ModulationMode(chan)==4 ||
-           ModulationMode(chan)==1); // NTSC listing in TVCT
+    if (ModulationMode(chan)>5)
+        str.append(QString("mod(UNKNOWN %1) ").arg(ModulationMode(chan)));
+    else
+        str.append(QString("mod(%1) ").arg(modnames[ModulationMode(chan)]));
     str.append(QString("cTSID(0x%1)\n").arg(ChannelTransportStreamID(chan), 0, 16));
     str.append(QString(" pnum(%1) ").arg(ProgramNumber(chan)));
     str.append(QString("ETM_loc(%1) ").arg(ETMlocation(chan)));

More information about the mythtv-dev mailing list