Reformat code

This commit is contained in:
Pierre HUBERT 2020-04-14 09:18:12 +02:00
parent 1b88b51c23
commit 85ddd9691d

View File

@ -228,6 +228,9 @@ func newCall(mainOffer receivedSignal, r *activeRelay) {
return
}
// Close peer connection
defer mainPeerConnection.Close()
// Check if the connection is closed
mainPeerConnection.OnConnectionStateChange(func(s webrtc.PeerConnectionState) {
if s == webrtc.PeerConnectionStateClosed {
@ -236,9 +239,6 @@ func newCall(mainOffer receivedSignal, r *activeRelay) {
}
})
// Close peer connection
defer mainPeerConnection.Close()
// Forward ice candidates
mainPeerConnection.OnICECandidate(func(c *webrtc.ICECandidate) {
if c == nil || r.closed {