Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: webrtc/modules/pacing/paced_sender.cc

Issue 2995183002: Fix for alr detection bug on pause. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/pacing/interval_budget.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/paced_sender.cc
diff --git a/webrtc/modules/pacing/paced_sender.cc b/webrtc/modules/pacing/paced_sender.cc
index acfcd1fbffc98dcf94eddb90966fe3b353dd7c84..74a885a66f2b6c64b43f8c22be28ccd434055fa7 100644
--- a/webrtc/modules/pacing/paced_sender.cc
+++ b/webrtc/modules/pacing/paced_sender.cc
@@ -406,7 +406,8 @@ int64_t PacedSender::TimeUntilNextProcess() {
void PacedSender::Process() {
int64_t now_us = clock_->TimeInMicroseconds();
rtc::CritScope cs(&critsect_);
- int64_t elapsed_time_ms = (now_us - time_last_update_us_ + 500) / 1000;
+ int64_t elapsed_time_ms = std::min(
+ kMaxIntervalTimeMs, (now_us - time_last_update_us_ + 500) / 1000);
int target_bitrate_kbps = pacing_bitrate_kbps_;
if (paused_) {
@@ -417,7 +418,7 @@ void PacedSender::Process() {
if (packet_counter_ == 0)
return;
size_t bytes_sent = SendPadding(1, pacing_info);
- alr_detector_->OnBytesSent(bytes_sent, now_us / 1000);
+ alr_detector_->OnBytesSent(bytes_sent, elapsed_time_ms);
return;
}
@@ -437,8 +438,6 @@ void PacedSender::Process() {
}
media_budget_->set_target_rate_kbps(target_bitrate_kbps);
-
- elapsed_time_ms = std::min(kMaxIntervalTimeMs, elapsed_time_ms);
UpdateBudgetWithElapsedTime(elapsed_time_ms);
}
« no previous file with comments | « webrtc/modules/pacing/interval_budget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698