Open winshining opened 2 years ago
I think the operator is wrong.
Should be &=
instead of modulo operator %=
.
@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)
...
Plz try the same with AND operator…
The
0xf
in the following line should be0x10
:https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/blob/8e344d799483145666fa875344bddf67a324e561/hls/ngx_rtmp_mpegts.c#L209
So the continuity counter can be 0x0 ~ 0xf, otherwise the range is 0x0 ~ 0xe.