[mythtv-commits] Ticket #9451: IPTVRecorder doesn't produce proper TS packets for big DVB tables.
MythTV
noreply at mythtv.org
Thu Jan 6 11:06:40 UTC 2011
#9451: IPTVRecorder doesn't produce proper TS packets for big DVB tables.
-------------------------------------------------+-------------------------
Reporter: Ino Dekker <ino.dekker@…> | Owner: danielk
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - Recording | Version: Trunk Head
Severity: medium | Keywords: iptv dvb ts
Ticket locked: 0 | recorder
-------------------------------------------------+-------------------------
If a channel is recorded from IPTV that contains a PAT and/or PMT table
that is bigger than the payload size of one TS packet (184), only the
first part is written to buffer (payload start indicator bit set).
Currently, in the functions IPTVRecorder::HandleSingleProgramPAT() and
IPTVRecorder::HandleSingleProgramPMT() write the table to buffer as one
(too) big packet:
For PAT:
{{{
//...
int next = (pat->tsheader()->ContinuityCounter()+1)&0xf;
pat->tsheader()->SetContinuityCounter(next);
BufferedWrite(*(reinterpret_cast<const TSPacket*>(pat->tsheader())));
//...
}}}
For PMT:
{{{
//...
int next = (pmt->tsheader()->ContinuityCounter()+1)&0xf;
pmt->tsheader()->SetContinuityCounter(next);
BufferedWrite(*(reinterpret_cast<const TSPacket*>(pmt->tsheader())));
//...
}}}
I modified the code to create a vector of the individual TS packets as
implemented in the DVBRecorder class.
The code will now look like:
For PAT:
{{{
//...
int next = (pat->tsheader()->ContinuityCounter()+1)&0xf;
pat->tsheader()->SetContinuityCounter(next);
pat->GetAsTSPackets(_scratch, next);
for (int i = 0; i < _scratch.size(); i++)
BufferedWrite(_scratch[i]);
//...
}}}
For PMT:
{{{
...
int next = (pmt->tsheader()->ContinuityCounter()+1)&0xf;
pmt->tsheader()->SetContinuityCounter(next);
pmt->GetAsTSPackets(_scratch, next);
for (int i = 0; i < _scratch.size(); i++)
BufferedWrite(_scratch[i]);
...
}}}
The following line should be added to IPTVRecorder.h in the private class
member section:
{{{
vector<TSPacket> _scratch;
}}}
I've successfully tested this fix on 0.23.0+fixes (Ubuntu 10.04). Since
the code hasn't changed in the trunk, I'm confident it will work there
too.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/9451>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list