Opened 14 years ago
Closed 14 years ago
#9451 closed Patch - Bug Fix (fixed)
IPTVRecorder doesn't produce proper TS packets for big DVB tables.
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | 0.25 |
Component: | MythTV - Recording | Version: | Master Head |
Severity: | medium | Keywords: | iptv dvb ts recorder |
Cc: | Ticket locked: | no |
Description
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.
Merge of various recorder changes from mythtv-rec2.
This will probably cause some regressions, that's why I'm pushing this on a Monday. This refactors all the recorders and stream readers to eliminate a lot of duplicate code, and also fixes a number of small bugs and long time annoyances see the dkristjansson/mythtv-rec branch for details.