Commit 0c4a6252 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Simplify computation of available down bitrate.

Don't take packet loss into account, just clamp at 384kbps.
parent ae7e32a3
...@@ -721,22 +721,12 @@ func updateUpBitrate(up *upConnection) { ...@@ -721,22 +721,12 @@ func updateUpBitrate(up *upConnection) {
} }
isvideo := l.track.Kind() == webrtc.RTPCodecTypeVideo isvideo := l.track.Kind() == webrtc.RTPCodecTypeVideo
minrate1 := uint64(9600) minrate := uint64(9600)
minrate2 := uint64(19200)
if isvideo { if isvideo {
minrate1 = 256000 minrate = 384000
minrate2 = 512000
} }
if bitrate < minrate2 { if bitrate < minrate {
loss := atomic.LoadUint32(&l.loss) bitrate = minrate
if loss <= 13 {
// less than 10% loss, go ahead
bitrate = minrate2
} else if loss <= 64 {
if bitrate < minrate1 {
bitrate = minrate1
}
}
} }
if track.maxBitrate > bitrate { if track.maxBitrate > bitrate {
track.maxBitrate = bitrate track.maxBitrate = bitrate
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment