fix restarting ICE log

This commit is contained in:
David Zhao
2021-05-17 11:00:34 -07:00
parent 442b819af9
commit 19e6909cbb
+7 -5
View File
@@ -172,14 +172,16 @@ func (t *PCTransport) CreateAndSendOffer(options *webrtc.OfferOptions) error {
iceRestart := options != nil && options.ICERestart iceRestart := options != nil && options.ICERestart
// if restart is requested, and we are not ready, then continue afterwards // if restart is requested, and we are not ready, then continue afterwards
if iceRestart && t.pc.ICEGatheringState() == webrtc.ICEGatheringStateGathering { if iceRestart {
logger.Debugw("restart ICE after gathering") if t.pc.ICEGatheringState() == webrtc.ICEGatheringStateGathering {
t.restartAfterGathering.Store(true) logger.Debugw("restart ICE after gathering")
return nil t.restartAfterGathering.Store(true)
return nil
}
logger.Debugw("restarting ICE")
} }
state := t.negotiationState.Load().(int) state := t.negotiationState.Load().(int)
logger.Debugw("restarting ICE")
// when there's an ongoing negotiation, let it finish and not disrupt its state // when there's an ongoing negotiation, let it finish and not disrupt its state
if state == negotiationStateClient { if state == negotiationStateClient {