From d4e3c6340606534de566ff711753c9902ce9918e Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Mon, 21 Oct 2024 23:58:41 +0530 Subject: [PATCH] Seed duplicate packets and bytes. (#3124) Had missed this before. This could have cause retransmit packets/bytes to be high. --- pkg/sfu/rtpstats/rtpstats_base.go | 10 +++------- pkg/sfu/rtpstats/rtpstats_base_lite.go | 6 ++++++ pkg/sfu/rtpstats/rtpstats_sender.go | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/sfu/rtpstats/rtpstats_base.go b/pkg/sfu/rtpstats/rtpstats_base.go index 5207c6d30..b978d00fa 100644 --- a/pkg/sfu/rtpstats/rtpstats_base.go +++ b/pkg/sfu/rtpstats/rtpstats_base.go @@ -195,6 +195,7 @@ func (r *rtpStatsBase) seed(from *rtpStatsBase) bool { } r.firstTime = from.firstTime + r.firstTimeAdjustment = from.firstTimeAdjustment r.highestTime = from.highestTime r.lastTransit = from.lastTransit @@ -202,6 +203,8 @@ func (r *rtpStatsBase) seed(from *rtpStatsBase) bool { r.headerBytes = from.headerBytes + r.packetsDuplicate = from.packetsDuplicate + r.bytesDuplicate = from.bytesDuplicate r.headerBytesDuplicate = from.headerBytesDuplicate r.packetsPadding = from.packetsPadding @@ -213,13 +216,6 @@ func (r *rtpStatsBase) seed(from *rtpStatsBase) bool { r.jitter = from.jitter r.maxJitter = from.maxJitter - r.nackAcks = from.nackAcks - r.nackMisses = from.nackMisses - r.nackRepeated = from.nackRepeated - - r.plis = from.plis - r.lastPli = from.lastPli - r.firs = from.firs r.lastFir = from.lastFir diff --git a/pkg/sfu/rtpstats/rtpstats_base_lite.go b/pkg/sfu/rtpstats/rtpstats_base_lite.go index bf2d031e1..ea6294351 100644 --- a/pkg/sfu/rtpstats/rtpstats_base_lite.go +++ b/pkg/sfu/rtpstats/rtpstats_base_lite.go @@ -125,6 +125,12 @@ func (r *rtpStatsBaseLite) seed(from *rtpStatsBaseLite) bool { r.gapHistogram = from.gapHistogram r.nacks = from.nacks + r.nackAcks = from.nackAcks + r.nackMisses = from.nackMisses + r.nackRepeated = from.nackRepeated + + r.plis = from.plis + r.lastPli = from.lastPli r.nextSnapshotLiteID = from.nextSnapshotLiteID r.snapshotLites = make([]snapshotLite, cap(from.snapshotLites)) diff --git a/pkg/sfu/rtpstats/rtpstats_sender.go b/pkg/sfu/rtpstats/rtpstats_sender.go index ad2af4c88..c78e513e6 100644 --- a/pkg/sfu/rtpstats/rtpstats_sender.go +++ b/pkg/sfu/rtpstats/rtpstats_sender.go @@ -203,12 +203,12 @@ func (r *RTPStatsSender) Seed(from *RTPStatsSender) { r.snInfos = from.snInfos + r.layerLockPlis = from.layerLockPlis + r.lastLayerLockPli = from.lastLayerLockPli + r.nextSenderSnapshotID = from.nextSenderSnapshotID r.senderSnapshots = make([]senderSnapshot, cap(from.senderSnapshots)) copy(r.senderSnapshots, from.senderSnapshots) - - r.layerLockPlis = from.layerLockPlis - r.lastLayerLockPli = from.lastLayerLockPli } func (r *RTPStatsSender) NewSnapshotId() uint32 {