From 5bed20f7c67c54940ca53bbcfc2c6be3dd3e6149 Mon Sep 17 00:00:00 2001 From: Per Date: Tue, 23 Aug 2016 22:00:07 +0200 Subject: [PATCH] Do not update stats for WebRTC.Call.EstimatedSendBitrateInKbps if we are not sending video. This hopefully fixes a UMA stats regression introduced in https://chromium.googlesource.com/external/webrtc/+/71ee44cc6d3049763da69e8e42a08d4b796b97db BUG=webrtc:6244 TBR=stefan@webrtc.org Review URL: https://codereview.webrtc.org/2274713002 . Cr-Commit-Position: refs/heads/master@{#13868} --- webrtc/call/call.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc index f6354ade28..ceec963ee2 100644 --- a/webrtc/call/call.cc +++ b/webrtc/call/call.cc @@ -735,6 +735,12 @@ void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, // Ignore updates where the bitrate is zero because the aggregate network // state is down. if (target_bitrate_bps > 0) { + { + ReadLockScoped read_lock(*send_crit_); + // Do not update the stats if we are not sending video. + if (video_send_streams_.empty()) + return; + } rtc::CritScope lock(&bitrate_crit_); // We only update these stats if we have send streams, and assume that // OnNetworkChanged is called roughly with a fixed frequency.