Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#9929 closed Bug Report - General (Invalid)

MPEGStreamData doesn't handle video packets without a payload

Reported by: Ron Frazier <ron@…> Owned by:
Priority: minor Milestone: unknown
Component: MythTV - General Version: 0.24-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I found a bug in the MPEGStreamData class that causes problems with the mpeg data I get from my cable provider. It appears to be a simple programming error (starting a loop counter from 1 instead of 0).

The data I get from my provider comes in the following format:
PID 0 - PAT
PID X - PMT
PID X+1 - video data
PID X+2 - audio data

Packets often come through on PID X+1 containing an adaption field but no payload. The adaption field contains the PCR data.

Since there is only 1 video packet and that loop starts from array index 1 instead of 0, the video packet never gets added to the list of Writing PIDs. Then, when MPEGStreamData::ProcessTSPacket processes one of these packets, it doesn't actually have a payload and the video PID is not a writing PID, so the packet gets discarded.

The resulting video appears to play fine in myth when there is a seek table, but without a seek table (like if you copy it to mythvideo) you cannot seek around in the file. Other players (VLC and Windows Media Player) refuse to play the file at all.

I'm attaching a patch that fixes the issue for me. This patch was generated against 0.24-fixes, but the code appears to be the same in trunk.

Attachments (1)

myth_mpeg_fix.patch (604 bytes) - added by Ron Frazier <ron@…> 13 years ago.

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by Ron Frazier <ron@…>

Attachment: myth_mpeg_fix.patch added

comment:1 Changed 12 years ago by danielk

Resolution: Invalid
Status: newclosed

Ron, that is not an off by one error, the first video pid gets put in _pid_video_single_program. The recorders use IsVideoPID() to determine that it should be written to disk, just like it does uses IsAudioPID() for the audio pids. The "IsWritingPID()" pids are one we just pass through and don't do any processing on. The video pid we want to locate keyframes on so that we can seek more efficiently.

comment:2 Changed 12 years ago by Github

Refs #9929. Process payloadless A/V packets.

Branch: master Changeset: 44210edf4b417c0d579e2c8143a03a8fa1179f47

Note: See TracTickets for help on using tickets.