Commit f34ec0ab authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Don't hide mismatches in the PeerConnection state automaton.

The previous behaviour led to silent failures, which was confusing.
parent f4811e8c
...@@ -569,16 +569,12 @@ func gotAnswer(c *webClient, id string, sdp string) error { ...@@ -569,16 +569,12 @@ func gotAnswer(c *webClient, id string, sdp string) error {
return ErrUnknownId return ErrUnknownId
} }
if down.pc.SignalingState() == webrtc.SignalingStateStable { err := down.pc.SetRemoteDescription(webrtc.SessionDescription{
log.Printf("Got answer in stable state -- this shouldn't happen") Type: webrtc.SDPTypeAnswer,
} else { SDP: sdp,
err := down.pc.SetRemoteDescription(webrtc.SessionDescription{ })
Type: webrtc.SDPTypeAnswer, if err != nil {
SDP: sdp, return err
})
if err != nil {
return err
}
} }
for _, t := range down.tracks { for _, t := range down.tracks {
...@@ -590,7 +586,7 @@ func gotAnswer(c *webClient, id string, sdp string) error { ...@@ -590,7 +586,7 @@ func gotAnswer(c *webClient, id string, sdp string) error {
} }
} }
err := down.flushICECandidates() err = down.flushICECandidates()
if err != nil { if err != nil {
log.Printf("ICE: %v", err) log.Printf("ICE: %v", err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment