Force full reconnect when there is no previous answer during migration. (#1168)
This commit is contained in:
@@ -1123,6 +1123,14 @@ func (t *PCTransport) initPCWithPreviousAnswer(previousAnswer webrtc.SessionDesc
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *PCTransport) SetPreviousSdp(offer, answer *webrtc.SessionDescription) {
|
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()
|
t.lock.Lock()
|
||||||
if t.pc.RemoteDescription() == nil && t.previousAnswer == nil {
|
if t.pc.RemoteDescription() == nil && t.previousAnswer == nil {
|
||||||
t.previousAnswer = answer
|
t.previousAnswer = answer
|
||||||
|
|||||||
Reference in New Issue
Block a user