-
Notifications
You must be signed in to change notification settings - Fork 51
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
Solve the the issue of non-DVB transport stream(TS) which using the PID, 0x10~0x1F, as the PIDs of the video/audio streams of program #54
base: master
Are you sure you want to change the base?
Conversation
…0x1F as the PID of the video/audio streams of programs
Which type of content are you demuxing (you say non-DVB, but what's the exact type?) and how can we identify it as non-DVB? |
I believe it is following the ATSC standard or just the IPTV transport stream which does not use those DVB metadata, NIT or SDT. It is not easy to identify the transport stream is following which standard, since both DVB and ATSC standards have their own specific PIDs for their system tables . I would suggest
|
OK thanks for the clarification 👍 In that case I would rather you add a new |
…sed by known elementary streams of programs in PMT tables
Updated to add a new |
} | ||
|
||
// setLocked sets a new stream id to the elementary stream | ||
func (m elementaryStreamMap) setLocked(pid, number uint16) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename Locked
to Unlocked
in all 3 functions?
The idea is to let the developer know the function is not locking any mutex while manipulating the map which is really unsafe.
pids = append(pids, i) | ||
} | ||
} | ||
assert.Equal(t, []int{0, 16, 17, 18, 19, 20, 30, 31}, pids) | ||
pm.setUnlocked(uint16(1), uint16(0)) | ||
assert.True(t, isPSIPayload(uint16(1), pm)) | ||
assert.True(t, isPSIPayload(uint16(1), pm, esm)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test using esm.setUnlocked()
like it was done with pm.setUnlocked(uint16(1), uint16(0))
above?
@@ -64,7 +65,7 @@ func TestParseData(t *testing.T) { | |||
Payload: p[33:], | |||
}, | |||
} | |||
ds, err = parseData(ps, nil, pm) | |||
ds, err = parseData(ps, nil, pm, esm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test using esm.setUnlocked()
like it was done with pm.setUnlocked(uint16(256), uint16(1))
above?
@@ -34,6 +34,7 @@ type Demuxer struct { | |||
packetBuffer *packetBuffer | |||
packetPool *packetPool | |||
programMap *programMap | |||
streamMap *elementaryStreamMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you order fields alphabetically?
Scenario
We got the sample transport stream from IPTV source, which using the PID 0x10 as the program PID, 0x11 as the video stream PID, and 0x12 as the audio stream PID. The transport stream would cause the PSI checksum error, while we tried to use the demux to get NextData() of the stream.
ISO Standard
According to the Table 2-3 -- PID table of the standard ISO/IEC 13818-1:2007, the PID range 0x0010~0x1FFE may be assigned as network PID, program map PID, elementary_PID, or for other purposes.
Changes