update protocol (#2593)

* update protocol

* cleanup

* deps
This commit is contained in:
Paul Wells
2024-03-21 02:48:26 -07:00
committed by GitHub
parent 7945c01dbe
commit 0f597e7e46
8 changed files with 28 additions and 24 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ type SubscribedTrack struct {
versionGenerator utils.TimedVersionGenerator
settingsLock sync.Mutex
settings *livekit.UpdateTrackSettings
settingsVersion *utils.TimedVersion
settingsVersion utils.TimedVersion
bindLock sync.Mutex
bound bool
@@ -243,7 +243,7 @@ func (t *SubscribedTrack) applySettings() {
}
t.logger.Debugw("updating subscriber track settings", "settings", logger.Proto(t.settings))
t.settingsVersion = t.versionGenerator.New()
t.settingsVersion = t.versionGenerator.Next()
settingsVersion := t.settingsVersion
t.settingsLock.Unlock()
@@ -264,7 +264,7 @@ func (t *SubscribedTrack) applySettings() {
}
t.settingsLock.Lock()
if settingsVersion.Compare(t.settingsVersion) != 0 {
if settingsVersion != t.settingsVersion {
// a newer settings has superceded this one
t.settingsLock.Unlock()
return