Update mute if necessary when updating track info. (#2357)

This commit is contained in:
Raja Subramanian
2024-01-02 23:32:43 +05:30
committed by GitHub
parent 73af5da956
commit 7c8b60431d

View File

@@ -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()
}