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); |