Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demuxer.NextData returns (nil, nil) on unknown data types #26

Closed
tmm1 opened this issue Apr 6, 2021 · 1 comment · Fixed by #32
Closed

demuxer.NextData returns (nil, nil) on unknown data types #26

tmm1 opened this issue Apr 6, 2021 · 1 comment · Fixed by #32

Comments

@tmm1
Copy link
Contributor

tmm1 commented Apr 6, 2021

This was a bit unexpected and I'm not sure if it was the desired/designed behavior?

I would have expected perhaps to receive a special error for unknown data, or simply have it skipped.

For example, SCTE35 tables are not understood and so this returns (nil, nil):

func TestDemuxerNextDataSCTE35(t *testing.T) {
	scte35 := hexToBytes(`4741f61900fc302500000003289800fff01405000002547fefff4fc614f8
fe00a4e9f50000000000000c1324f6ffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffff`)
	r := bytes.NewReader(scte35)
	assert.Equal(t, 188, r.Len())

	dmx := NewDemuxer(context.Background(), r, DemuxerOptPacketSize(188))
	dmx.programMap.set(502, 1)

	d, err := dmx.NextData()
	assert.NoError(t, err)
	assert.NotNil(t, d)
	assert.Equal(t, uint16(502), d.FirstPacket.Header.PID)
	//assert.NotNil(t, d.SCTE35)
}

Similar behavior is also seen on #25 for PMT tables other than program_map

@aler9
Copy link
Contributor

aler9 commented Sep 30, 2021

Just realized that this is fixed by #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants