Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Fix startRtpSenders : panic when RemoveTrack called.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnderrauber committed May 24, 2021
1 parent 74cad3c commit 2ef6dbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions peerconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -1320,13 +1320,13 @@ func (pc *PeerConnection) startRTPReceivers(incomingTracks []trackDetails, curre
// startRTPSenders starts all outbound RTP streams
func (pc *PeerConnection) startRTPSenders(currentTransceivers []*RTPTransceiver) error {
for _, transceiver := range currentTransceivers {
if transceiver.Sender() != nil && transceiver.Sender().isNegotiated() && !transceiver.Sender().hasSent() {
err := transceiver.Sender().Send(RTPSendParameters{
if sender := transceiver.Sender(); sender != nil && sender.isNegotiated() && !sender.hasSent() {
err := sender.Send(RTPSendParameters{
Encodings: []RTPEncodingParameters{
{
RTPCodingParameters{
SSRC: transceiver.Sender().ssrc,
PayloadType: transceiver.Sender().payloadType,
SSRC: sender.ssrc,
PayloadType: sender.payloadType,
},
},
},
Expand Down

0 comments on commit 2ef6dbd

Please sign in to comment.