update core to 0.0.5 (#1540)
* update core * sort imports * fix typos * redundant types
This commit is contained in:
@@ -6,13 +6,12 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/frostbyte73/core"
|
||||
"github.com/pion/webrtc/v3"
|
||||
"go.uber.org/atomic"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/sfu/buffer"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
"github.com/pion/webrtc/v3"
|
||||
|
||||
"github.com/livekit/livekit-server/pkg/sfu/buffer"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -227,13 +226,14 @@ func (cs *ConnectionStats) updateStatsWorker() {
|
||||
tk := time.NewTicker(interval)
|
||||
defer tk.Stop()
|
||||
|
||||
done := cs.done.Watch()
|
||||
for {
|
||||
select {
|
||||
case <-cs.done.Watch():
|
||||
case <-done:
|
||||
return
|
||||
|
||||
case <-tk.C:
|
||||
if cs.done.IsClosed() {
|
||||
if cs.done.IsBroken() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -247,13 +247,15 @@ func (cs *ConnectionStats) updateStatsWorker() {
|
||||
// how much weight to give to packet loss rate when calculating score.
|
||||
// It is codec dependent.
|
||||
// For audio:
|
||||
// o Opus without FEC or RED suffers the most through packet loss, hence has the highest weight
|
||||
// o RED with two packet redundancy can absorb two out of every three packets lost, so packet loss is not as detrimental and therefore lower weight
|
||||
//
|
||||
// o Opus without FEC or RED suffers the most through packet loss, hence has the highest weight
|
||||
// o RED with two packet redundancy can absorb two out of every three packets lost, so packet loss is not as detrimental and therefore lower weight
|
||||
//
|
||||
// For video:
|
||||
// o No in-built codec repair available, hence same for all codecs
|
||||
//
|
||||
// o No in-built codec repair available, hence same for all codecs
|
||||
func getPacketLossWeight(mimeType string, isFecEnabled bool) float64 {
|
||||
plw := float64(0.0)
|
||||
var plw float64
|
||||
switch {
|
||||
case strings.EqualFold(mimeType, webrtc.MimeTypeOpus):
|
||||
// 2.5%: fall to GOOD, 7.5%: fall to POOR
|
||||
|
||||
Reference in New Issue
Block a user