Skip to content

Commit

Permalink
Fix receiveForRtx usage for simulcast
Browse files Browse the repository at this point in the history
  • Loading branch information
aalekseevx committed Apr 18, 2024
1 parent fc3ef75 commit 09ce8b3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rtpreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 442 in rtpreceiver.go

View check run for this annotation

Codecov / codecov/patch

rtpreceiver.go#L437-L442

Added lines #L437 - L442 were not covered by tests
}
}
}()
return nil

Check warning on line 446 in rtpreceiver.go

View check run for this annotation

Codecov / codecov/patch

rtpreceiver.go#L446

Added line #L446 was not covered by tests
}

go func() {
for {
b := r.rtxPool.Get().([]byte) // nolint:forcetypeassert
Expand Down

0 comments on commit 09ce8b3

Please sign in to comment.