Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Apr 13, 2023
1 parent d26c35f commit ec87d12
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 @@ -71,14 +71,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 @@ -58,9 +58,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 ec87d12

Please sign in to comment.