You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For reference, see my fixes for the same bug in ffmpeg and ingots
(FYI this contains another variant where some PMT payloads don't contain the program map table).
funcTestDemuxerNextDataPMTMutipleTables(t*testing.T) {
// pmt with two tables in one packet, with 0xc0 preceeding the 0x2 program mappmt:=hexToBytes(`47403b1e00c000150000010061000000000000010000000045491be065f0050e030004b00fe066f0060a04656e670086e06ef0007fc9ad32ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`)
r:=bytes.NewReader(pmt)
assert.Equal(t, 188, r.Len())
dmx:=NewDemuxer(context.Background(), r, DemuxerOptPacketSize(188))
dmx.programMap.set(59, 1)
d, err:=dmx.NextData()
assert.NoError(t, err)
assert.NotNil(t, d)
assert.Equal(t, uint16(59), d.FirstPacket.Header.PID)
assert.NotNil(t, d.PMT)
}
funcTestDemuxerNextDataPMTComplex(t*testing.T) {
// complex pmt with two tables (0xc0 and 0x2) split across two packetspmt:=hexToBytes(`47403b1e00c00015000001006100000000000001000000000035e3e2d702b0b20001c50000eefdf01809044749e10b050441432d330504454143330504435545491beefdf0102a027e1f9700e9080c001f418507d04181eefef00f810706380fff1f003f0a04656e670081eefff00f8107061003ff1f003f0a047370610086ef00f00f8a01009700e9080c001f418507d041c0ef01f012050445545631a100e9080c001f418507d041c0ef02f013050445545631a20100e9080c001f47003b1f418507d041c0ef03f008bf06496e76696469a5cff3afffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`)
r:=bytes.NewReader(pmt)
assert.Equal(t, 188*2, r.Len())
dmx:=NewDemuxer(context.Background(), r, DemuxerOptPacketSize(188))
dmx.programMap.set(59, 1)
d, err:=dmx.NextData()
assert.NoError(t, err)
assert.NotNil(t, d)
assert.Equal(t, uint16(59), d.FirstPacket.Header.PID)
assert.NotNil(t, d.PMT)
}
The text was updated successfully, but these errors were encountered:
tmm1
changed the title
demuxer fails to parse complex PMT spanning multiple packets
demuxer fails to parse complex PMT with multiple tables
Apr 6, 2021
The PMT in https://s3.amazonaws.com/tmm1/combined-pmt-tids.ts cannot be parsed by go-astits.
For reference, see my fixes for the same bug in ffmpeg and in gots
(FYI this contains another variant where some PMT payloads don't contain the program map table).
The text was updated successfully, but these errors were encountered: