Skip to content

Commit

Permalink
webrtc: fix crash in case of congestion (#3813) (#3815)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Sep 29, 2024
1 parent 9f83b57 commit 1e30dcb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/protocols/webrtc/peer_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,14 @@ func (co *PeerConnection) Start() error {

switch state {
case webrtc.PeerConnectionStateConnected:
// for some reasons, PeerConnectionStateConnected can arrive twice.
// https://github.com/bluenviron/mediamtx/issues/3813
select {
case <-co.connected:
return
default:
}

co.Log.Log(logger.Info, "peer connection established, local candidate: %v, remote candidate: %v",
co.LocalCandidate(), co.RemoteCandidate())

Expand Down

0 comments on commit 1e30dcb

Please sign in to comment.