Prevent subscription after participant close. (#1182)
This commit is contained in:
@@ -1949,6 +1949,11 @@ func (p *ParticipantImpl) onAnyTransportNegotiationFailed() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub types.LocalParticipant) error) {
|
func (p *ParticipantImpl) EnqueueSubscribeTrack(trackID livekit.TrackID, isRelayed bool, f func(sub types.LocalParticipant) error) {
|
||||||
|
// do not queue subscription is participant is already closed/disconnected
|
||||||
|
if p.isClosed.Load() || p.State() == livekit.ParticipantInfo_DISCONNECTED {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
|
p.params.Logger.Debugw("queuing subscribe", "trackID", trackID, "relayed", isRelayed)
|
||||||
|
|
||||||
p.supervisor.UpdateSubscription(trackID, true)
|
p.supervisor.UpdateSubscription(trackID, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user