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

Unified Diff: webrtc/video/video_quality_test.cc

Issue 1727583003: Only average positive quality stats. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index 4e39514301f80962be07a800148befc6c831ac2d..0fc125c7596711032099a48adbe65919e8598b4c 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -387,10 +387,16 @@ class VideoAnalyzer : public PacketReceiver,
VideoSendStream::Stats stats = send_stream_->GetStats();
rtc::CritScope crit(&comparison_lock_);
- encode_frame_rate_.AddSample(stats.encode_frame_rate);
- encode_time_ms.AddSample(stats.avg_encode_time_ms);
- encode_usage_percent.AddSample(stats.encode_usage_percent);
- media_bitrate_bps.AddSample(stats.media_bitrate_bps);
+ // It's not certain that we yet have estimates for any of these stats. Check
+ // that they are positive before mixing them in.
+ if (stats.encode_frame_rate > 0)
+ encode_frame_rate_.AddSample(stats.encode_frame_rate);
+ if (stats.avg_encode_time_ms > 0)
+ encode_time_ms.AddSample(stats.avg_encode_time_ms);
+ if (stats.encode_usage_percent > 0)
+ encode_usage_percent.AddSample(stats.encode_usage_percent);
+ if (stats.media_bitrate_bps > 0)
+ media_bitrate_bps.AddSample(stats.media_bitrate_bps);
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698