Opened 16 years ago

Closed 15 years ago

#9451 closed Patch - Bug Fix (fixed)

IPTVRecorder doesn't produce proper TS packets for big DVB tables.

Reported by: Ino Dekker <ino.dekker@…> 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.

Change History (2)

comment:1 by Kenni Lund [kenni a kelu dot dk], 16 years ago

Status: newassigned

comment:2 by Github, 15 years ago

Milestone: unknown0.25
Resolution: fixed
Status: assignedclosed

Merge of various recorder changes from mythtv-rec2.

  • Fixes #9191. Channel switching doesn't work with cx18 driver.
  • Fixes #9451. IPTVRecorder doesn't produce proper TS packets for big DVB tables.
  • Fixes #9709. TFW IOBOUND.
  • This also fixes pause status locking in various recorders.
  • This also replaces a few spinlocks with QWaitConditions.
  • This also adds a DVB ASI recorder implementation in just 1033 lines. (Uninteresting to most).
  • This makes changes to the DeviceReadBuffer to make it more efficient and quicker to respond.
  • This changes the ThreadedFileWriter so that it can expand the level of buffering it does when there are temporary slowdowns in writing to disk.

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.

Branch: master Changeset: 9b22460f53bf6313516f33987e4260897c6076a3

Note: See TracTickets for help on using tickets.