ICE restart - dynacast settings were lost (#620)
* Prevent stats update if the deltas are empty * increase force interval * static check * Change max delay to 30 seconds * Restart the max subscribed quality timer on ICE restart. Force an update after a restart to let clients apply dynacast settings. Also, set the max expected layer to HIGH on restart so that stream tracker starts up fast on a restart. * fix test
This commit is contained in:
@@ -65,7 +65,7 @@ func NewMediaTrackSubscriptions(params MediaTrackSubscriptionsParams) *MediaTrac
|
||||
pendingClose: make(map[livekit.ParticipantID]types.SubscribedTrack),
|
||||
maxSubscriberQuality: make(map[livekit.ParticipantID]livekit.VideoQuality),
|
||||
maxSubscriberNodeQuality: make(map[livekit.NodeID]livekit.VideoQuality),
|
||||
maxSubscribedQuality: livekit.VideoQuality_LOW,
|
||||
maxSubscribedQuality: livekit.VideoQuality_HIGH,
|
||||
maxSubscribedQualityDebounce: debounce.New(params.VideoConfig.DynacastPauseDelay),
|
||||
}
|
||||
|
||||
@@ -73,7 +73,11 @@ func NewMediaTrackSubscriptions(params MediaTrackSubscriptionsParams) *MediaTrac
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) Start() {
|
||||
t.startMaxQualityTimer()
|
||||
t.startMaxQualityTimer(false)
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) Restart() {
|
||||
t.startMaxQualityTimer(true)
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) Close() {
|
||||
@@ -546,7 +550,7 @@ func (t *MediaTrackSubscriptions) UpdateQualityChange(force bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *MediaTrackSubscriptions) startMaxQualityTimer() {
|
||||
func (t *MediaTrackSubscriptions) startMaxQualityTimer(force bool) {
|
||||
t.maxQualityLock.Lock()
|
||||
defer t.maxQualityLock.Unlock()
|
||||
|
||||
@@ -556,7 +560,7 @@ func (t *MediaTrackSubscriptions) startMaxQualityTimer() {
|
||||
|
||||
t.maxQualityTimer = time.AfterFunc(initialQualityUpdateWait, func() {
|
||||
t.stopMaxQualityTimer()
|
||||
t.UpdateQualityChange(false)
|
||||
t.UpdateQualityChange(force)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user