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())
|
delete(t.subscribedTracks, sub.ID())
|
||||||
t.lock.Unlock()
|
t.lock.Unlock()
|
||||||
|
|
||||||
|
t.params.Stats.SubSubscribedTrack(t.kind.String())
|
||||||
|
|
||||||
// ignore if the subscribing sub is not connected
|
// ignore if the subscribing sub is not connected
|
||||||
if sub.SubscriberPC().ConnectionState() == webrtc.PeerConnectionStateClosed {
|
if sub.SubscriberPC().ConnectionState() == webrtc.PeerConnectionStateClosed {
|
||||||
return
|
return
|
||||||
@@ -195,7 +197,6 @@ func (t *MediaTrack) AddSubscriber(sub types.Participant) error {
|
|||||||
|
|
||||||
sub.RemoveSubscribedTrack(t.params.ParticipantID, subTrack)
|
sub.RemoveSubscribedTrack(t.params.ParticipantID, subTrack)
|
||||||
sub.Negotiate()
|
sub.Negotiate()
|
||||||
t.params.Stats.SubSubscribedTrack(t.kind.String())
|
|
||||||
})
|
})
|
||||||
|
|
||||||
t.subscribedTracks[sub.ID()] = subTrack
|
t.subscribedTracks[sub.ID()] = subTrack
|
||||||
|
|||||||
Reference in New Issue
Block a user