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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2029593002: Update RateStatistics to handle too-little-data case. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comment Created 4 years, 6 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/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/receive_statistics_proxy.cc
diff --git a/webrtc/video/receive_statistics_proxy.cc b/webrtc/video/receive_statistics_proxy.cc
index 4757efa81b6cf3435212fea2f3e4dbb53d283734..4970982ad5c4c40bc87ec19520bd7b54128399d0 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -247,7 +247,7 @@ void ReceiveStatisticsProxy::OnDecodedFrame() {
rtc::CritScope lock(&crit_);
decode_fps_estimator_.Update(1, now);
- stats_.decode_frame_rate = decode_fps_estimator_.Rate(now);
+ stats_.decode_frame_rate = decode_fps_estimator_.Rate(now).value_or(0);
}
void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
@@ -257,7 +257,7 @@ void ReceiveStatisticsProxy::OnRenderedFrame(int width, int height) {
rtc::CritScope lock(&crit_);
renders_fps_estimator_.Update(1, now);
- stats_.render_frame_rate = renders_fps_estimator_.Rate(now);
+ stats_.render_frame_rate = renders_fps_estimator_.Rate(now).value_or(0);
render_width_counter_.Add(width);
render_height_counter_.Add(height);
render_fps_tracker_.AddSamples(1);
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698