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) {
|
func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo) {
|
||||||
|
updateMute := false
|
||||||
clonedInfo := proto.Clone(ti).(*livekit.TrackInfo)
|
clonedInfo := proto.Clone(ti).(*livekit.TrackInfo)
|
||||||
|
|
||||||
t.lock.Lock()
|
t.lock.Lock()
|
||||||
@@ -622,9 +623,16 @@ func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo) {
|
|||||||
clonedInfo.Layers = ci.Layers
|
clonedInfo.Layers = ci.Layers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if t.trackInfo.Muted != clonedInfo.Muted {
|
||||||
|
updateMute = true
|
||||||
|
}
|
||||||
t.trackInfo = clonedInfo
|
t.trackInfo = clonedInfo
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
|
|
||||||
|
if updateMute {
|
||||||
|
t.SetMuted(clonedInfo.Muted)
|
||||||
|
}
|
||||||
|
|
||||||
t.updateTrackInfoOfReceivers()
|
t.updateTrackInfoOfReceivers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user