Skip to content

dynamically choose between ThroughputRule and BolaRule

Created by: spiterikevin

This PR dynamically chooses between ThroughputRule and BolaRule to get strengths of both.

  • ThroughputRule is desirable in transient conditions such as startup and seeking.
  • BolaRule is desirable in stable conditions with sufficient buffer.

A new stream starts on ThroughputRule and then switches to BolaRule when the buffer level reaches a threshold, switching back to ThroughputRule when the buffer level drops below a (lower-than-the-first) threshold and so on.

Note that while the automatic rule switching gets the best of both rules, both ThroughputRule and BolaRule can work well without the other.

After this change, the rich buffer rule is no longer needed. The rich buffer rule code in the AbrController is replaced by the new switching mechanism.

This PR builds on two previous ones:

#2003 introduced ThroughputHistory, reducing duplication (there was similar code in both ThroughputRule and BolaRule). ThroughputHistory also helps keep track of throughput even when the ThroughputRule is not active. Also, InsufficientBufferRule was updated to better handle low-buffer situations.

#2068 updated BolaRule to work alongside other rules, mainly by no longer assuming it is the only rule active. Particularly, if BolaRule is used after another rule has been used for a while, BolaRule will take the previous rule’s bitrate into account to avoid bitrate oscillations.

Merge request reports