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 hvcC box writing using incorrect order of operations #409

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

Andrews54757
Copy link
Contributor

Current code:

stream.writeUint8(this.general_profile_space << 6 +
  this.general_tier_flag << 5 +
  this.general_profile_idc);

is equivalent to

stream.writeUint8(this.general_profile_space << (6 +
  this.general_tier_flag) << (5 +
  this.general_profile_idc));

which is incorrect. The correct order of operations are:

stream.writeUint8((this.general_profile_space << 6) +
  (this.general_tier_flag << 5) +
  this.general_profile_idc);

This fixes the file segmenter tool producing invalid hvcC boxes for certain kinds of hvc1 video.

@rbouqueau
Copy link
Member

LGTM, merging. Thank you!

@rbouqueau rbouqueau merged commit 2c15bfd into gpac:master Oct 6, 2024
3 checks passed
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 this pull request may close these issues.

2 participants