diff --git a/rtpreceiver.go b/rtpreceiver.go index 2457ba080a8..ea8848d5841 100644 --- a/rtpreceiver.go +++ b/rtpreceiver.go @@ -433,6 +433,19 @@ func (r *RTPReceiver) receiveForRtx(ssrc SSRC, rsid string, streamInfo *intercep track.repairRtcpInterceptor = rtcpInterceptor track.repairStreamChannel = make(chan rtxPacketWithAttributes) + // If this function is called to read simulcast layer, do not apply rtx logic + if ssrc == 0 { + go func() { + b := make([]byte, r.api.settingEngine.getReceiveMTU()) + for { + if _, _, readErr := track.repairInterceptor.Read(b, nil); readErr != nil { + return + } + } + }() + return nil + } + go func() { for { b := r.rtxPool.Get().([]byte) // nolint:forcetypeassert