Code inspection (#581)

* Code inspection

* fix [4]int64 conversiong
This commit is contained in:
David Colburn
2022-03-30 13:49:53 -07:00
committed by GitHub
parent 26f7bb498a
commit 0b8a180554
77 changed files with 228 additions and 151 deletions
+4 -3
View File
@@ -4,9 +4,10 @@ import (
"sync"
"time"
"go.uber.org/atomic"
"github.com/livekit/livekit-server/pkg/utils"
"github.com/livekit/protocol/logger"
"go.uber.org/atomic"
)
type StreamStatus int32
@@ -228,12 +229,12 @@ func (s *StreamTracker) Observe(sn uint16, temporalLayer int32, pktSize int) {
}
// BitrateTemporalCumulative returns the current stream bitrate temporal layer accumulated with lower temporal layers.
func (s *StreamTracker) BitrateTemporalCumulative() [4]int64 {
func (s *StreamTracker) BitrateTemporalCumulative() []int64 {
s.lock.RLock()
defer s.lock.RUnlock()
// copy and process
var brs [4]int64
brs := make([]int64, len(s.bitrate))
for i := 0; i < len(s.bitrate); i++ {
brs[i] = s.bitrate[i]
}