mirror of
https://github.com/livekit/livekit.git
synced 2026-12-05 11:16:22 +00:00
Update mute if necessary when updating track info. (#2357)
This commit is contained in:
1 parent
73af5da956
commit
7c8b60431d
1 file changed
+8
@@ -590,6 +590,7 @@ func (t *MediaTrackReceiver) UpdateCodecCid(codecs []*livekit.SimulcastCodec) {
|
||||
}
|
||||
|
||||
func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo) {
|
||||
updateMute := false
|
||||
clonedInfo := proto.Clone(ti).(*livekit.TrackInfo)
|
||||
|
||||
t.lock.Lock()
|
||||
@@ -622,9 +623,16 @@ func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo) {
|
||||
clonedInfo.Layers = ci.Layers
|
||||
}
|
||||
}
|
||||
if t.trackInfo.Muted != clonedInfo.Muted {
|
||||
updateMute = true
|
||||
}
|
||||
t.trackInfo = clonedInfo
|
||||
t.lock.Unlock()
|
||||
|
||||
if updateMute {
|
||||
t.SetMuted(clonedInfo.Muted)
|
||||
}
|
||||
|
||||
t.updateTrackInfoOfReceivers()
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user