mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 17:45:40 +00:00
Update mute if necessary when updating track info. (#2357)
This commit is contained in:
@@ -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