1
1
mirror of https://github.com/wader/fq.git synced 2024-08-16 07:20:32 +03:00
This commit is contained in:
Mattias Wadman 2023-01-22 10:48:37 +01:00
parent 03316988aa
commit 70f174a8b5
2 changed files with 4 additions and 10 deletions

View File

@ -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
} }

View File

@ -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"
} }