Skip to content

Commit ebf2648

Browse files
committed
hold lock for checkNegotiationNeeded transceiver checks
1 parent b97c9b4 commit ebf2648

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

peerconnection.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ func (pc *PeerConnection) checkNegotiationNeeded() bool { //nolint:gocognit
338338
return true
339339
}
340340

341-
for _, t := range pc.GetTransceivers() {
341+
pc.mu.Lock()
342+
defer pc.mu.Unlock()
343+
344+
for _, t := range pc.rtpTransceivers {
342345
// https://www.w3.org/TR/webrtc/#dfn-update-the-negotiation-needed-flag
343346
// Step 5.1
344347
// if t.stopping && !t.stopped {

0 commit comments

Comments
 (0)