From b5de6460735d00bc89015c363abf28ad8afa36e6 Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Sat, 30 Mar 2024 00:31:26 +0530 Subject: [PATCH] Remove redundant check. (#2605) * Remove redundant check. That check is already at the ouside check. * print string * space --- pkg/sfu/buffer/rtpstats_receiver.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/sfu/buffer/rtpstats_receiver.go b/pkg/sfu/buffer/rtpstats_receiver.go index fcce8e411..4c3476f78 100644 --- a/pkg/sfu/buffer/rtpstats_receiver.go +++ b/pkg/sfu/buffer/rtpstats_receiver.go @@ -414,23 +414,23 @@ func (r *RTPStatsReceiver) SetRtcpSenderReportData(srData *RTCPSenderReportData) } else { resetDelta() - if deltaPropagationDelay.Abs() > cPropagationDelayDeltaThresholdMin { - factor := cPropagationDelayFallFactor - if propagationDelay > r.propagationDelay { - factor = cPropagationDelayRiseFactor - } - fields := append( - getPropagationFields(), - "adjustedPropagationDelay", r.propagationDelay+time.Duration(factor*float64(propagationDelay-r.propagationDelay)), - ) // TODO-REMOVE - r.logger.Debugw("adapting propagation delay", fields...) // TODO-REMOVE - r.propagationDelay += time.Duration(factor * float64(propagationDelay-r.propagationDelay)) + factor := cPropagationDelayFallFactor + if propagationDelay > r.propagationDelay { + factor = cPropagationDelayRiseFactor } + adjustedPropagationDelay := r.propagationDelay + time.Duration(factor*float64(propagationDelay-r.propagationDelay)) // TODO-REMOVE + fields := append( + getPropagationFields(), + "adjustedPropagationDelay", adjustedPropagationDelay.String(), + ) // TODO-REMOVE + r.logger.Debugw("adapting propagation delay", fields...) // TODO-REMOVE + r.propagationDelay += time.Duration(factor * float64(propagationDelay-r.propagationDelay)) } } else { r.propagationDelayDeltaHighCount = 0 r.propagationDelayDeltaHighStartTime = time.Time{} } + if r.longTermDeltaPropagationDelay == 0 { r.longTermDeltaPropagationDelay = deltaPropagationDelay } else {