mirror of
https://github.com/livekit/livekit.git
synced 2026-08-05 19:29:27 +00:00
Initialize subscriber quality to default layer (#444)
This commit is contained in:
@@ -256,6 +256,10 @@ func (t *MediaTrackSubscriptions) AddSubscriber(sub types.LocalParticipant, code
|
||||
sub.Negotiate()
|
||||
}()
|
||||
|
||||
t.maxQualityLock.Lock()
|
||||
// initialize to default layer
|
||||
t.maxSubscriberQuality[sub.ID()] = livekit.VideoQuality_HIGH
|
||||
t.maxQualityLock.Unlock()
|
||||
t.params.Telemetry.TrackSubscribed(context.Background(), subscriberID, t.params.MediaTrack.ToProto())
|
||||
return downTrack, nil
|
||||
}
|
||||
@@ -529,17 +533,6 @@ func (t *MediaTrackSubscriptions) stopMaxQualityTimer() {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) numSubscribedLayers() uint32 {
|
||||
t.maxQualityLock.RLock()
|
||||
numSubscribedLayers := uint32(0)
|
||||
if t.maxSubscribedQuality != livekit.VideoQuality_OFF {
|
||||
numSubscribedLayers = uint32(SpatialLayerForQuality(t.maxSubscribedQuality) + 1)
|
||||
}
|
||||
t.maxQualityLock.RUnlock()
|
||||
|
||||
return numSubscribedLayers
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) maybeNotifyNoSubscribers() {
|
||||
if t.onNoSubscribers == nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user