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

Incorrect continuity counter in TS header #341

Open
winshining opened this issue Dec 27, 2021 · 3 comments
Open

Incorrect continuity counter in TS header #341

winshining opened this issue Dec 27, 2021 · 3 comments

Comments

@winshining
Copy link

The 0xf in the following line should be 0x10:

mpegts_cc %= 0x0f;

So the continuity counter can be 0x0 ~ 0xf, otherwise the range is 0x0 ~ 0xe.

@premultiply
Copy link

I think the operator is wrong.
Should be &= instead of modulo operator %=.

@winshining
Copy link
Author

@premultiply No. &= means getting the 4 least significant bits of the octet of mpegts_cc, but the continuity counter field in TS header loops periodically from 0x0 to 0xf. The operator is ok but the operand should be 0x10 (decimal 16), so the continuity counter will repeat from 0x0 to 0xf:

0 % 16 = 0 (0x0)
1 % 16 = 1 (0x1)
...
15 % 16 = 15 (0xf)
16 % 16 = 0 (0x0)
...
31 % 16 = 15 (0xf)
32 % 16 = 0 (0x0)
...

@premultiply
Copy link

Plz try the same with AND operator…

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

2 participants