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

Unified Diff: webrtc/video/receive_statistics_proxy.cc

Issue 2577073002: ReceiveStatisticsProxy: add some unit tests, change members from int to int64_t. (Closed)
Patch Set: add unit tests Created 3 years, 12 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/video/receive_statistics_proxy.h ('k') | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | 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 6bf9a74cf9fdc8ba9273a37f136c50131e82697e..541a183aca6c76c52ff4c03f4de0442f9d62ab04 100644
--- a/webrtc/video/receive_statistics_proxy.cc
+++ b/webrtc/video/receive_statistics_proxy.cc
@@ -442,10 +442,11 @@ void ReceiveStatisticsProxy::SampleCounter::Add(int sample) {
++num_samples;
}
-int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const {
+int ReceiveStatisticsProxy::SampleCounter::Avg(
+ int64_t min_required_samples) const {
if (num_samples < min_required_samples || num_samples == 0)
return -1;
- return sum / num_samples;
+ return static_cast<int>(sum / num_samples);
}
void ReceiveStatisticsProxy::SampleCounter::Reset() {
« no previous file with comments | « webrtc/video/receive_statistics_proxy.h ('k') | webrtc/video/receive_statistics_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698