mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-15 14:52:04 +00:00
rtpgccbwe: Don't use clamp()
if there's no clear min/max value
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/305 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1086>
This commit is contained in:
parent
da7743d2e7
commit
5f70c0f5fe
1 changed files with 14 additions and 5 deletions
|
@ -850,11 +850,20 @@ impl State {
|
|||
let threshold_on_effective_bitrate = 1.5 * effective_bitrate as f64;
|
||||
let increase = f64::max(
|
||||
1000.0f64,
|
||||
// Stuffing should ensure that the effective bitrate is not
|
||||
// < target bitrate, still, make sure to always increase
|
||||
// the bitrate by a minimum amount of 160.bits
|
||||
(threshold_on_effective_bitrate - self.target_bitrate_on_delay as f64)
|
||||
.clamp(160.0, alpha * avg_packet_size_bits),
|
||||
// The below is not `clamp()`
|
||||
#[allow(clippy::manual_clamp)]
|
||||
{
|
||||
f64::min(
|
||||
alpha * avg_packet_size_bits,
|
||||
// Stuffing should ensure that the effective bitrate is not
|
||||
// < target bitrate, still, make sure to always increase
|
||||
// the bitrate by a minimum amount of 160.bits
|
||||
f64::max(
|
||||
threshold_on_effective_bitrate - self.target_bitrate_on_delay as f64,
|
||||
160.0,
|
||||
),
|
||||
)
|
||||
},
|
||||
);
|
||||
|
||||
/* Additive increase */
|
||||
|
|
Loading…
Reference in a new issue