properly cleanup downtracks on subscriber disconnect

This commit is contained in:
David Zhao
2021-05-12 23:40:41 -07:00
parent 447f2d589b
commit bbadd4ccb6
2 changed files with 17 additions and 2 deletions
+3
View File
@@ -156,6 +156,9 @@ func (t *PCTransport) CreateAndSendOffer(options *webrtc.OfferOptions) error {
if t.onOffer == nil {
return nil
}
if t.pc.ConnectionState() == webrtc.PeerConnectionStateClosed {
return nil
}
state := t.negotiationState.Load().(int)
// when there's an ongoing negotiation, let it finish and not disrupt its state