From 70f174a8b5ac0abed70e12764f66ab51fd90ac84 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Sun, 22 Jan 2023 10:48:37 +0100 Subject: [PATCH] wip --- format/mpeg/mpeg_ts.go | 10 ++-------- format/mpeg/mpeg_ts_packet.go | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/format/mpeg/mpeg_ts.go b/format/mpeg/mpeg_ts.go index 54ef14d9..b1eb05cf 100644 --- a/format/mpeg/mpeg_ts.go +++ b/format/mpeg/mpeg_ts.go @@ -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 } diff --git a/format/mpeg/mpeg_ts_packet.go b/format/mpeg/mpeg_ts_packet.go index b252f948..243cc84c 100644 --- a/format/mpeg/mpeg_ts_packet.go +++ b/format/mpeg/mpeg_ts_packet.go @@ -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" }