From cdb5f3ed68d7d8be9d63aeda583e0ef712240ddc Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Sun, 23 Jun 2024 00:33:56 +0530 Subject: [PATCH] Log more around unexpected cases (#2813) - too many padding packets - also fix cse of snapshot not getting any packets --- pkg/sfu/buffer/rtpstats_base.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 {