Repository navigation
Conversation
ISO/IEC 13818-1 2.4.4.3 places those fields at payload[6] and payload[7] after the pointer_field is skipped.
Author
|
Closing this. Not something I'm going to keep current. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TransportParseStream.parsePatnow readssection_numberandlast_section_numberatpayload[6]andpayload[7]. AfterparsePsiskipspointer_field, those fields are atpayload[6]andpayload[7], not[7]and[8], so the old read was one byte too late (ISO/IEC 13818-1 2.4.4.3).parsePmtalready uses the same PSI header indexing (payload[5]=current_next_indicator).pmtPidatpayload[10]/[11]is unchanged. That matches the reporter and the spec; the in-tree PAT fixture already depended on it.A QUnit case copies the shared PAT fixture and sets distinctive section numbers. The fixture zeros both fields, which hid the off-by-one against
last_section_number/program_number.Fixes #432.
Decision
Only the two section-number indexes change. That matches the issue, the spec, and
parsePmt. Nothing in this repo reads the section fields today (ElementaryStream's PAT handler is empty), but they are still emitted on the PATdataevent.The alternative is to skip a leading
program_number == 0(NIT) when selectingpmtPid, or to stop attaching the unused section fields. Can switch to skipping NIT entries or dropping the unused fields.Test plan
npx qunit test/dist/bundle.js --filter "parses section_number and last_section_number from the PAT"fails on the old indexes (actual5 and 0) and passes with this changenpx qunit test/dist/bundle.js --filter "MP2T TransportParseStream"(9 tests)npx qunit test/dist/bundle.js(338 passed, 4 skipped)