Don't hide mismatches in the PeerConnection state automaton.
The previous behaviour led to silent failures, which was confusing.
This commit is contained in:
@@ -569,9 +569,6 @@ func gotAnswer(c *webClient, id string, sdp string) error {
|
|||||||
return ErrUnknownId
|
return ErrUnknownId
|
||||||
}
|
}
|
||||||
|
|
||||||
if down.pc.SignalingState() == webrtc.SignalingStateStable {
|
|
||||||
log.Printf("Got answer in stable state -- this shouldn't happen")
|
|
||||||
} else {
|
|
||||||
err := down.pc.SetRemoteDescription(webrtc.SessionDescription{
|
err := down.pc.SetRemoteDescription(webrtc.SessionDescription{
|
||||||
Type: webrtc.SDPTypeAnswer,
|
Type: webrtc.SDPTypeAnswer,
|
||||||
SDP: sdp,
|
SDP: sdp,
|
||||||
@@ -579,7 +576,6 @@ func gotAnswer(c *webClient, id string, sdp string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for _, t := range down.tracks {
|
for _, t := range down.tracks {
|
||||||
local := t.track.Codec()
|
local := t.track.Codec()
|
||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user