mirror of
https://github.com/livekit/livekit.git
synced 2026-07-28 16:29:28 +00:00
correctly subtract subscribed tracks
This commit is contained in:
@@ -166,6 +166,8 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
|
||||
delete(t.subscribedTracks, sub.ID())
|
||||
t.lock.Unlock()
|
||||
|
||||
t.params.Stats.SubSubscribedTrack(t.kind.String())
|
||||
|
||||
// ignore if the subscribing sub is not connected
|
||||
if sub.SubscriberPC().ConnectionState() == webrtc.PeerConnectionStateClosed {
|
||||
return
|
||||
@@ -195,7 +197,6 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
|
||||
|
||||
sub.RemoveSubscribedTrack(t.params.ParticipantID, subTrack)
|
||||
sub.Negotiate()
|
||||
t.params.Stats.SubSubscribedTrack(t.kind.String())
|
||||
})
|
||||
|
||||
t.subscribedTracks[sub.ID()] = subTrack
|
||||
|
||||
Reference in New Issue
Block a user