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

Fix PCR reserved bits not being set correctly #895

Merged
merged 3 commits into from
Feb 3, 2021

Conversation

JPeMu
Copy link
Contributor

@JPeMu JPeMu commented Feb 2, 2021

This is a PR to address the issue reported in #893

The PCR value inside the TS Packet's Adaptation Field (where present) should be represented as:

program_clock_reference_base (33 bits)
reserved (6 bits)
program_clock_reference_extension (9 bits)

(Bit Positions)
.... ...4 .... .... .3.. .... ...2 .... .... .1.. .... ....
7654 3210 9876 5432 1098 7654 3210 9876 5432 1098 7654 3210
BBBB BBBB BBBB BBBB BBBB BBBB BBBB BBBB Brrr rrrE EEEE EEEE
----- most_significant_32bits_pcr -----|pcr_last_bit_reserved_and_pcr_extension
            (uint32_t)                         (uint16_t)

B = Base, r = reserved, E = Extension

The reserved bits should always be set to '1' per ISO 13818-1 therefore OR'ing a value of 0x7e00 is required to set these reserved bits imho.

Tony

@JPeMu
Copy link
Contributor Author

JPeMu commented Feb 3, 2021

This is my first PR here, so I apologise for the unittest fail back-and-forth. I've also had to update the golden files for .ts now that I understand how to run the full test suite as obviously this change affects some bits in the output files. Hope this is the correct approach?

@kqyang
Copy link
Contributor

kqyang commented Feb 3, 2021

@JPeMu Thanks for the fix! And yes, that is the correct approach.

I'll merge it once the build-bots completes successfully.

@kqyang kqyang merged commit 36ef7ec into shaka-project:master Feb 3, 2021
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants