Keep track of pending subscriber operations. (#814)

* Keep track of pending subscriber operations.

This is required to determine if a receiver does not have
any subscription.

* correct spelling of queuing

* lock around hasPermission
This commit is contained in:
Raja Subramanian
2022-07-06 23:48:28 +05:30
committed by GitHub
parent fbb1f9fc80
commit ef66404a1a
4 changed files with 90 additions and 31 deletions
+6 -4
View File
@@ -93,11 +93,8 @@ func (t *MediaTrackSubscriptions) Restart() {
}
func (t *MediaTrackSubscriptions) Stop() {
t.stopMaxQualityTimer()
}
func (t *MediaTrackSubscriptions) Close() {
t.qualityNotifyOpQueue.Stop()
t.stopMaxQualityTimer()
}
func (t *MediaTrackSubscriptions) OnDownTrackCreated(f func(downTrack *sfu.DownTrack)) {
@@ -702,6 +699,11 @@ func (t *MediaTrackSubscriptions) startMaxQualityTimer(force bool) {
return
}
if t.maxQualityTimer != nil {
t.maxQualityTimer.Stop()
t.maxQualityTimer = nil
}
t.maxQualityTimer = time.AfterFunc(initialQualityUpdateWait, func() {
t.stopMaxQualityTimer()
t.UpdateQualityChange(force)