Skip to content

Commit

Permalink
Fix potential improper rate check in simulcast logic (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 authored Jun 14, 2023
1 parent b8f8152 commit 18a9857
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions service/rtc/simulcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ func (s *session) initBWEstimator(bwEstimator cc.BandwidthEstimator) {
bwEstimator.SetTargetBitrate(newRate)
}

// We update the cached rates since the actual source rate could be lower than
// the previous ones, causing an improper check above next time the event fires.
lastDelayRate = newRate
lastLossRate = newRate

lastLevelChangeAt = time.Now()
currLevel = newLevel
}
Expand Down

0 comments on commit 18a9857

Please sign in to comment.