Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#438 closed patch (fixed)

DVB multiple PMT sections per TSPacket fix

Reported by: redmundt@… Owned by: danielk
Priority: minor Milestone: 0.19
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Some DVB channels broadcast multiple PMT sections per TSPacket. The current behavior only parses the first PMT section in the TSPacket skipping or losing some of them. This results in the inability to tune to all of the channels on a transponder due to not finding the PMT. This patch reworks AssemblePSIP and HandleTSTables to loop over the packets to ensure that all the PMT segments are found. It has only been tested on NA DVB signals.

The patch probably needs a few things renamed.

Attachments (1)

multiplePMT.patch (11.7 KB) - added by redmundt@… 18 years ago.

Download all attachments as: .zip

Change History (10)

Changed 18 years ago by redmundt@…

Attachment: multiplePMT.patch added

comment:1 Changed 18 years ago by Isaac Richards

Owner: changed from Isaac Richards to danielk

comment:2 Changed 18 years ago by danielk

Status: newassigned

This patch causes a SEGFAULT for me:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1362867280 (LWP 9834)]
0xb7b57232 in MasterGuideTable::TablePID (this=0x811b730, i=0) at atsctables.h:108
108             return ((_ptrs[i][2]<<8) | (_ptrs[i][3])) & 0x1fff;
(gdb) bt
#0  0xb7b57232 in MasterGuideTable::TablePID (this=0x811b730, i=0) at atsctables.h:108
#1  0xb7b54dea in DTVSignalMonitor::SetMGT (this=0x810ae68, mgt=0x811b730)
    at dtvsignalmonitor.cpp:263
#2  0xb7cf61c7 in DTVSignalMonitor::qt_invoke (this=0x810ae68, _id=5, _o=0xaec44150)
    at moc_dtvsignalmonitor.cpp:121
#3  0xb7d04ce7 in DVBSignalMonitor::qt_invoke (this=0x810ae68, _id=5, _o=0xaec44150)
    at moc_dvbsignalmonitor.cpp:143
#4  0x43977c91 in QObject::activate_signal (this=0x811de38, clist=0x811b1d8, o=0xaec44150)
    at qconnection.h:56
#5  0xb7cfee3e in ATSCStreamData::UpdateMGT (this=0x811de38, t0=0x811b730)
    at moc_atscstreamdata.cpp:196
#6  0xb7bd911e in ATSCStreamData::HandleTables (this=0x811de38, pid=8187, psip=@0x81199a0)
    at atscstreamdata.cpp:148
#7  0xb7bd1aae in MPEGStreamData::HandleTSTables (this=0x811de38, tspacket=0xae193008)
    at mpegstreamdata.cpp:466
#8  0xb7bd1c41 in MPEGStreamData::ProcessTSPacket (this=0x811de38, tspacket=@0xae193008)
    at mpegstreamdata.cpp:505
#9  0xb7bd1b7e in MPEGStreamData::ProcessData (this=0x811de38,
    buffer=0xae193008 "G_û\035", len=188) at mpegstreamdata.cpp:490
#10 0xb7c7f0e3 in DVBSignalMonitor::RunTableMonitor (this=0x810ae68)
    at dvbsignalmonitor.cpp:298
#11 0xb7c7d369 in DVBSignalMonitor::TableMonitorThread (param=0x810ae68)
    at dvbsignalmonitor.cpp:144
#12 0x419b3aba in start_thread (arg=0xaec44bb0) at pthread_create.c:261
#13 0x418141ee in clone () from /lib/tls/libc.so.6

Also use ANSI C bracing, not K&R in any new code. Don't go over 80 columns, "if" is a keyword not a function, & please document any new methods you add.

comment:3 Changed 18 years ago by redmundt@…

I saw this crash as well after I added the new field to PESPacket, a make clean of libmythtv solved this for me. I suspected the dependancies were not exactly perfect, but didn't look farther into it. Please let me know if you had done a full rebuild and I'll look farther into the SEGV you are seeing.

I'll rehash the patch with the latest changes from SVN, and fix up the formatting. I'm not sure exactly what I should be changing with respect to "if" being a keyword vs a function. I will need that explained before I can appropriately fix it.

comment:4 Changed 18 years ago by Isaac Richards

'if' is not a function, so: 'if (foo)' is preferred over 'if(foo)'.

comment:5 Changed 18 years ago by danielk

I'll try a make clean right now.

Hold off on the formatting changes, I already formatted that version of the patch.

I didn't attach it because it contained some other changes too.

comment:6 Changed 18 years ago by redmundt@…

Thanks for the clarification.

comment:7 Changed 18 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [7438]) Closes #438. (must do make clean). This allows multiple PES Packets per TS Packet.

You must do a "make clean" if you use a DVB or HDTV recorder, otherwise you will probably experience SEGFAULTS.

This is patch submitted by redmundt AT gmail.com, with minor modifications.

redmundt, please confirm this works for you.

comment:8 Changed 18 years ago by redmundt@…

I will test this out as soon as my recordings finish, thanks.

comment:9 Changed 18 years ago by redmundt@…

This is working for me now, thanks (tested revision 7452)

Note: See TracTickets for help on using tickets.