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()
|
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())
|
t.params.Telemetry.TrackSubscribed(context.Background(), subscriberID, t.params.MediaTrack.ToProto())
|
||||||
return downTrack, nil
|
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() {
|
func (t *MediaTrackSubscriptions) maybeNotifyNoSubscribers() {
|
||||||
if t.onNoSubscribers == nil {
|
if t.onNoSubscribers == nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user