From d40041d01353974cd9c51a1a3d31bf65bf0d1c1c Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 29 Feb 2024 22:48:36 +0530 Subject: [PATCH] Use the correct snapshot id for PPS. (#2528) * Use the correct snapshot id for PPS. That caused connection quality to operate on small windows. * remove debug --- pkg/sfu/buffer/buffer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/sfu/buffer/buffer.go b/pkg/sfu/buffer/buffer.go index 06c27b6bf..b2e6b75a7 100644 --- a/pkg/sfu/buffer/buffer.go +++ b/pkg/sfu/buffer/buffer.go @@ -103,7 +103,7 @@ type Buffer struct { rtpStats *RTPStatsReceiver rrSnapshotId uint32 deltaStatsSnapshotId uint32 - ppsSnapshortId uint32 + ppsSnapshotId uint32 lastFractionLostToReport uint8 // Last fraction lost from subscribers, should report to publisher; Audio only @@ -193,7 +193,7 @@ func (b *Buffer) Bind(params webrtc.RTPParameters, codec webrtc.RTPCodecCapabili }) b.rrSnapshotId = b.rtpStats.NewSnapshotId() b.deltaStatsSnapshotId = b.rtpStats.NewSnapshotId() - b.ppsSnapshortId = b.rtpStats.NewSnapshotId() + b.ppsSnapshotId = b.rtpStats.NewSnapshotId() b.clockRate = codec.ClockRate b.lastReport = time.Now() @@ -790,7 +790,7 @@ func (b *Buffer) mayGrowBucket() { return } oldCap := cap - deltaInfo := b.rtpStats.DeltaInfo(b.deltaStatsSnapshotId) + deltaInfo := b.rtpStats.DeltaInfo(b.ppsSnapshotId) if deltaInfo != nil && deltaInfo.Duration > 500*time.Millisecond { pps := int(time.Duration(deltaInfo.Packets) * time.Second / deltaInfo.Duration) for pps > cap && cap < maxPkts {