Commit 70dee15f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Rename rate.Add to rate.Accumulate.

parent c4284a45
...@@ -286,7 +286,7 @@ func (down *rtpDownTrack) WriteRTP(packet *rtp.Packet) error { ...@@ -286,7 +286,7 @@ func (down *rtpDownTrack) WriteRTP(packet *rtp.Packet) error {
} }
func (down *rtpDownTrack) Accumulate(bytes uint32) { func (down *rtpDownTrack) Accumulate(bytes uint32) {
down.rate.Add(bytes) down.rate.Accumulate(bytes)
} }
func (down *rtpDownTrack) GetMaxBitrate(now uint64) uint64 { func (down *rtpDownTrack) GetMaxBitrate(now uint64) uint64 {
......
...@@ -33,7 +33,7 @@ func (e *Estimator) swap(now time.Time) { ...@@ -33,7 +33,7 @@ func (e *Estimator) swap(now time.Time) {
e.time = now e.time = now
} }
func (e *Estimator) Add(count uint32) { func (e *Estimator) Accumulate(count uint32) {
atomic.AddUint32(&e.count, count) atomic.AddUint32(&e.count, count)
} }
......
...@@ -10,8 +10,8 @@ func TestEstimator(t *testing.T) { ...@@ -10,8 +10,8 @@ func TestEstimator(t *testing.T) {
e := New(time.Second) e := New(time.Second)
e.estimate(now) e.estimate(now)
e.Add(42) e.Accumulate(42)
e.Add(128) e.Accumulate(128)
e.estimate(now.Add(time.Second)) e.estimate(now.Add(time.Second))
rate := e.estimate(now.Add(time.Second + time.Millisecond)) rate := e.estimate(now.Add(time.Second + time.Millisecond))
......
...@@ -422,7 +422,7 @@ func readLoop(conn *upConnection, track *upTrack) { ...@@ -422,7 +422,7 @@ func readLoop(conn *upConnection, track *upTrack) {
} }
break break
} }
track.rate.Add(uint32(bytes)) track.rate.Accumulate(uint32(bytes))
err = packet.Unmarshal(buf[:bytes]) err = packet.Unmarshal(buf[:bytes])
if err != nil { if err != nil {
...@@ -1050,7 +1050,7 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *rtpDownTrack) { ...@@ -1050,7 +1050,7 @@ func sendRecovery(p *rtcp.TransportLayerNack, track *rtpDownTrack) {
log.Printf("WriteRTP: %v", err) log.Printf("WriteRTP: %v", err)
continue continue
} }
track.rate.Add(uint32(l)) track.rate.Accumulate(uint32(l))
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment