Skip to content

Commit

Permalink
rename startSN and endSN for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
kcaffrey committed Sep 28, 2023
1 parent f89f02a commit 854b15e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/twcc/twcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,18 @@ func (r *Recorder) BuildFeedbackPacket() []rtcp.Packet {
func (r *Recorder) maybeBuildFeedbackPacket(beginSeqNumInclusive, endSeqNumExclusive int64) *feedback {
// NOTE: The logic of this method is inspired by the implementation in Chrome.
// See https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc;l=276;drc=b5cd13bb6d5d157a5fbe3628b2dd1c1e106203c6
startSN, endSN := r.arrivalTimeMap.Clamp(beginSeqNumInclusive), r.arrivalTimeMap.Clamp(endSeqNumExclusive)
startSNInclusive, endSNExclusive := r.arrivalTimeMap.Clamp(beginSeqNumInclusive), r.arrivalTimeMap.Clamp(endSeqNumExclusive)

// Create feedback on demand, as we don't yet know if there are packets in the range that have been
// received.
var fb *feedback

nextSequenceNumber := beginSeqNumInclusive

for seq := startSN; seq < endSN; seq++ {
for seq := startSNInclusive; seq < endSNExclusive; seq++ {
foundSeq, arrivalTime, ok := r.arrivalTimeMap.FindNextAtOrAfter(seq)
seq = foundSeq
if !ok || seq >= endSN {
if !ok || seq >= endSNExclusive {
break
}

Expand Down

0 comments on commit 854b15e

Please sign in to comment.