ProbeController: Limit max probing bitrate

BUG=webrtc:6332

Review-Url: https://codereview.webrtc.org/2352093002
Cr-Commit-Position: refs/heads/master@{#14436}
This commit is contained in:
isheriff 2016-09-29 05:36:59 -07:00 committed by Commit bot
parent 606018600e
commit 8e6a76194d

View File

@ -10,6 +10,7 @@
#include "webrtc/modules/congestion_controller/probe_controller.h"
#include <algorithm>
#include <initializer_list>
#include "webrtc/base/logging.h"
@ -31,6 +32,9 @@ constexpr int64_t kMaxWaitingTimeForProbingResultMs = 1000;
// further probing is disabled.
constexpr int kExponentialProbingDisabled = 0;
// A limit to prevent probing at excessive bitrates.
constexpr int kMaxProbingBitrateBps = 10000000;
} // namespace
ProbeController::ProbeController(PacedSender* pacer, Clock* clock)
@ -97,6 +101,7 @@ void ProbeController::InitiateProbing(
int min_bitrate_to_probe_further_bps) {
bool first_cluster = true;
for (int bitrate : bitrates_to_probe) {
bitrate = std::min(bitrate, kMaxProbingBitrateBps);
if (first_cluster) {
pacer_->CreateProbeCluster(bitrate, kProbeDeltasPerCluster + 1);
first_cluster = false;