mirror of
https://github.com/pion/webrtc.git
synced 2025-09-27 03:25:58 +08:00
Fix our-of-order twcc fb cause by rtx blocked
Fix #2830. The TrackRemote.Read could block in readRTP if the buffer is empty then rtx packets arrival before next media rtp packet will be readed after the next media rtp packet and cause out-of-order fb and mess up remote peer's bandwidth estimation.
This commit is contained in:
@@ -433,7 +433,7 @@ func (r *RTPReceiver) receiveForRtx(ssrc SSRC, rsid string, streamInfo *intercep
|
|||||||
track.repairInterceptor = rtpInterceptor
|
track.repairInterceptor = rtpInterceptor
|
||||||
track.repairRtcpReadStream = rtcpReadStream
|
track.repairRtcpReadStream = rtcpReadStream
|
||||||
track.repairRtcpInterceptor = rtcpInterceptor
|
track.repairRtcpInterceptor = rtcpInterceptor
|
||||||
track.repairStreamChannel = make(chan rtxPacketWithAttributes)
|
track.repairStreamChannel = make(chan rtxPacketWithAttributes, 50)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
@@ -483,6 +483,8 @@ func (r *RTPReceiver) receiveForRtx(ssrc SSRC, rsid string, streamInfo *intercep
|
|||||||
r.rtxPool.Put(b) // nolint:staticcheck
|
r.rtxPool.Put(b) // nolint:staticcheck
|
||||||
return
|
return
|
||||||
case track.repairStreamChannel <- rtxPacketWithAttributes{pkt: b[:i-2], attributes: attributes, pool: &r.rtxPool}:
|
case track.repairStreamChannel <- rtxPacketWithAttributes{pkt: b[:i-2], attributes: attributes, pool: &r.rtxPool}:
|
||||||
|
default:
|
||||||
|
// skip the RTX packet if the repair stream channel is full, could be blocked in the application's read loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
Reference in New Issue
Block a user