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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc

Issue 2715133002: Remove extra call to TimeUntilNextProcess from within Process. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index 51d79cd9c24a45add670b789589f9ad59b20ec88..094bf0d65bed6af0ae194a09cf857f3174524b09 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -143,9 +143,6 @@ void RemoteBitrateEstimatorSingleStream::IncomingPacket(
}
void RemoteBitrateEstimatorSingleStream::Process() {
- if (TimeUntilNextProcess() > 0) {
- return;
- }
terelius 2017/02/27 13:13:14 So we can rely on the ProcessThread not calling Pr
tommi 2017/02/27 13:39:03 Yes. If Process() gets called when its not suppose
{
CriticalSectionScoped cs(crit_sect_.get());
UpdateEstimate(clock_->TimeInMilliseconds());
@@ -157,11 +154,10 @@ int64_t RemoteBitrateEstimatorSingleStream::TimeUntilNextProcess() {
if (last_process_time_ < 0) {
return 0;
}
- {
- CriticalSectionScoped cs_(crit_sect_.get());
- return last_process_time_ + process_interval_ms_ -
- clock_->TimeInMilliseconds();
- }
+ CriticalSectionScoped cs_(crit_sect_.get());
+ RTC_DCHECK_GT(process_interval_ms_, 0);
+ return last_process_time_ + process_interval_ms_ -
+ clock_->TimeInMilliseconds();
}
void RemoteBitrateEstimatorSingleStream::UpdateEstimate(int64_t now_ms) {
@@ -202,6 +198,7 @@ void RemoteBitrateEstimatorSingleStream::UpdateEstimate(int64_t now_ms) {
uint32_t target_bitrate = remote_rate->UpdateBandwidthEstimate(now_ms);
if (remote_rate->ValidEstimate()) {
process_interval_ms_ = remote_rate->GetFeedbackInterval();
+ RTC_DCHECK_GT(process_interval_ms_, 0);
std::vector<uint32_t> ssrcs;
GetSsrcs(&ssrcs);
observer_->OnReceiveBitrateChanged(ssrcs, target_bitrate);
« no previous file with comments | « no previous file | webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698