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

function parsePat section_number, last_section_number offset wrong in lib/m2ts/m2ts.js #432

Open
jjnetcn opened this issue Jun 15, 2023 · 0 comments

Comments

@jjnetcn
Copy link

jjnetcn commented Jun 15, 2023

parsePat = function(payload, pat) {
pat.section_number = payload[7]; // eslint-disable-line camelcase
pat.last_section_number = payload[8]; // eslint-disable-line camelcase

// skip the PSI header and parse the first PMT entry
self.pmtPid = (payload[10] & 0x1F) << 8 | payload[11];
pat.pmtPid = self.pmtPid;

};

i check ISO_IEC_13818-1 2.4.4.3
the section_number should be payload[6], last_section_number is payload[7]
while program_map_PID is part of payload[10] and payload[11] .

program_association_section() {
table_id 8 uimsbf
section_syntax_indicator 1 bslbf
'0' 1 bslbf
reserved 2 bslbf
section_length 12 uimsbf
transport_stream_id 16 uimsbf
reserved 2 bslbf
version_number 5 uimsbf
current_next_indicator 1 bslbf
section_number 8 uimsbf
last_section_number 8 uimsbf
for (i = 0; i < N; i++) {
program_number 16 uimsbf
reserved 3 bslbf
if (program_number = = '0') {
network_PID 13 uimsbf
} else {
program_map_PID 13 uimsbf
}
}
CRC_32 32 rpchof
}

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

No branches or pull requests

1 participant