mirror of
https://github.com/wader/fq.git
synced 2024-08-16 07:20:32 +03:00
wip
This commit is contained in:
parent
03316988aa
commit
70f174a8b5
@ -73,14 +73,8 @@ func (tb *tsBuffer) Reset() {
|
|||||||
|
|
||||||
func tsContinuityUpdate(tcm map[int]int, pid int, current int) bool {
|
func tsContinuityUpdate(tcm map[int]int, pid int, current int) bool {
|
||||||
prev, prevFound := tcm[pid]
|
prev, prevFound := tcm[pid]
|
||||||
valid := (prevFound && ((prev+1)&0xf == current)) || current == 0
|
valid := prevFound && ((prev+1)&0xf == current)
|
||||||
if valid {
|
tcm[pid] = current
|
||||||
tcm[pid] = current
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
if prevFound {
|
|
||||||
delete(tcm, pid)
|
|
||||||
}
|
|
||||||
return valid
|
return valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +59,9 @@ func tsPacketDecode(d *decode.D) any {
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case prevFound && (prev+1)&0xf == current:
|
case prevFound && (prev+1)&0xf == current:
|
||||||
s.Description = "valid"
|
s.Description = "continuous"
|
||||||
case prevFound:
|
case prevFound:
|
||||||
s.Description = "invalid"
|
s.Description = "non-continuous"
|
||||||
default:
|
default:
|
||||||
s.Description = "unknown"
|
s.Description = "unknown"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user