Force full reconnect when there is no previous answer during migration. (#1168)

This commit is contained in:
Raja Subramanian
2022-11-17 10:17:56 +05:30
committed by GitHub
parent 8c8a4d245c
commit fd1cc36bdc
+8
View File
@@ -1123,6 +1123,14 @@ func (t *PCTransport) initPCWithPreviousAnswer(previousAnswer webrtc.SessionDesc
}
func (t *PCTransport) SetPreviousSdp(offer, answer *webrtc.SessionDescription) {
// when there is no previous answer, cannot migrate, force a full reconnect
if answer == nil {
if onNegotiationFailed := t.getOnNegotiationFailed(); onNegotiationFailed != nil {
onNegotiationFailed()
}
return
}
t.lock.Lock()
if t.pc.RemoteDescription() == nil && t.previousAnswer == nil {
t.previousAnswer = answer