1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-22 16:45:58 +01:00

Reset remote connection if SetRemoteDescription fails.

In current versions of pion, SetRemoteDescription fails if ICE is
currently gathering.  Work around the issue by resetting the connection.
This commit is contained in:
Juliusz Chroboczek 2020-09-03 13:34:39 +02:00
parent e0a81e7f03
commit 5a91a7aae8

View file

@ -463,7 +463,7 @@ func gotOffer(c *webClient, id string, offer webrtc.SessionDescription, renegoti
delUpConn(c, id) delUpConn(c, id)
} }
up, _, err := addUpConn(c, id) up, isnew, err := addUpConn(c, id)
if err != nil { if err != nil {
return err return err
} }
@ -473,6 +473,11 @@ func gotOffer(c *webClient, id string, offer webrtc.SessionDescription, renegoti
} }
err = up.pc.SetRemoteDescription(offer) err = up.pc.SetRemoteDescription(offer)
if err != nil { if err != nil {
if renegotiate && !isnew {
// create a new PC from scratch
log.Printf("SetRemoteDescription(offer): %v", err)
return gotOffer(c, id, offer, false, labels)
}
return err return err
} }