From 82192f524e21143f84dd8a79bb2d55bc8de5e0db Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Wed, 16 Mar 2022 17:58:25 +0800 Subject: [PATCH] fix migration state (#520) --- pkg/rtc/participant.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index c0cdd53c3..ea8dc260f 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -571,6 +571,8 @@ func (p *ParticipantImpl) SetMigrateState(s types.MigrateState) { } pendingOffer = p.pendingOffer p.pendingOffer = nil + // in case of migration, subscriber data channel will not fire OnOpen callback + p.activeCounter.CAS(0, 2) } p.lock.Unlock() if s == types.MigrateStateComplete {