Handle answers in stable state.
Don't break the stream, just ignore the SDP.
This commit is contained in:
+12
-7
@@ -554,12 +554,17 @@ func gotAnswer(c *webClient, id string, sdp string) error {
|
|||||||
if down == nil {
|
if down == nil {
|
||||||
return ErrUnknownId
|
return ErrUnknownId
|
||||||
}
|
}
|
||||||
err := down.pc.SetRemoteDescription(webrtc.SessionDescription{
|
|
||||||
Type: webrtc.SDPTypeAnswer,
|
if down.pc.SignalingState() == webrtc.SignalingStateStable {
|
||||||
SDP: sdp,
|
log.Printf("Got answer in stable state -- this shouldn't happen")
|
||||||
})
|
} else {
|
||||||
if err != nil {
|
err := down.pc.SetRemoteDescription(webrtc.SessionDescription{
|
||||||
return err
|
Type: webrtc.SDPTypeAnswer,
|
||||||
|
SDP: sdp,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, t := range down.tracks {
|
for _, t := range down.tracks {
|
||||||
@@ -571,7 +576,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