Skip to content

Commit c785f25

Browse files
committed
Fix leak in Simulcast probing
If probing was still in flight closing the PeerConnection would not interupt it properly. cherry-pick of b549c95
1 parent e593588 commit c785f25

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

peerconnection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,17 +1660,17 @@ func (pc *PeerConnection) undeclaredRTPMediaProcessor() {
16601660
continue
16611661
}
16621662

1663+
pc.dtlsTransport.storeSimulcastStream(stream)
1664+
16631665
if atomic.AddUint64(&simulcastRoutineCount, 1) >= simulcastMaxProbeRoutines {
16641666
atomic.AddUint64(&simulcastRoutineCount, ^uint64(0))
16651667
pc.log.Warn(ErrSimulcastProbeOverflow.Error())
1666-
pc.dtlsTransport.storeSimulcastStream(stream)
16671668
continue
16681669
}
16691670

16701671
go func(rtpStream io.Reader, ssrc SSRC) {
16711672
if err := pc.handleIncomingSSRC(rtpStream, ssrc); err != nil {
16721673
pc.log.Errorf(incomingUnhandledRTPSsrc, ssrc, err)
1673-
pc.dtlsTransport.storeSimulcastStream(stream)
16741674
}
16751675
atomic.AddUint64(&simulcastRoutineCount, ^uint64(0))
16761676
}(stream, SSRC(ssrc))

0 commit comments

Comments
 (0)