diff --git a/pkg/sfu/buffer/rtpstats_base.go b/pkg/sfu/buffer/rtpstats_base.go index e588f1dcb..a3ab05126 100644 --- a/pkg/sfu/buffer/rtpstats_base.go +++ b/pkg/sfu/buffer/rtpstats_base.go @@ -38,7 +38,7 @@ const ( cPassthroughNTPTimestamp = true - cSequenceNumberLargeJumpThreshold = 1000 + cSequenceNumberLargeJumpThreshold = 100 ) // ------------------------------------------------------- @@ -583,6 +583,9 @@ func (r *rtpStatsBase) deltaInfo(snapshotID uint32, extStartSN uint64, extHighes endTime := now.startTime packetsExpected := now.extStartSN - then.extStartSN + if then.extStartSN > extHighestSN { + packetsExpected = 0 + } if packetsExpected > cNumSequenceNumbers { r.logger.Infow( "too many packets expected in delta", @@ -614,8 +617,10 @@ func (r *rtpStatsBase) deltaInfo(snapshotID uint32, extStartSN uint64, extHighes "padding packets more than expected", "packetsExpected", packetsExpected, "packetsPadding", packetsPadding, + "packetsLost", packetsLost, "startSequenceNumber", then.extStartSN, "endSequenceNumber", now.extStartSN-1, + "rtpStats", r, ) packetsExpected = 0 } else {