Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed May 1, 2023
1 parent d843b39 commit d910b08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions format/mpeg/mpeg_ts.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,8 @@ func (tb *tsBuffer) Reset() {

func tsContinuityUpdate(tcm map[int]int, pid int, current int) bool {
prev, prevFound := tcm[pid]
valid := (prevFound && ((prev+1)&0xf == current)) || current == 0
if valid {
tcm[pid] = current
return true
}
if prevFound {
delete(tcm, pid)
}
valid := prevFound && ((prev+1)&0xf == current)
tcm[pid] = current
return valid
}

Expand Down
4 changes: 2 additions & 2 deletions format/mpeg/mpeg_ts_packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ func tsPacketDecode(d *decode.D) any {

switch {
case prevFound && (prev+1)&0xf == current:
s.Description = "valid"
s.Description = "continuous"
case prevFound:
s.Description = "invalid"
s.Description = "non-continuous"
default:
s.Description = "unknown"
}
Expand Down

0 comments on commit d910b08

Please sign in to comment.