Index: content/renderer/media/media_stream_audio_processor_options.cc |
diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc |
index c39b1544c5c878a13abf2a7c4b64a41319d978f1..8029b25dc81b06e900763c5affc96db0ffe01fc0 100644 |
--- a/content/renderer/media/media_stream_audio_processor_options.cc |
+++ b/content/renderer/media/media_stream_audio_processor_options.cc |
@@ -222,12 +222,20 @@ bool MediaAudioConstraints::GetDefaultValueForConstraint( |
} |
EchoInformation::EchoInformation() |
- : num_chunks_(0) {} |
+ : num_chunks_(0), echo_frames_received_(false) { |
+} |
EchoInformation::~EchoInformation() {} |
void EchoInformation::UpdateAecDelayStats( |
webrtc::EchoCancellation* echo_cancellation) { |
+ // Only start collecting stats if we know echo cancellation has measured an |
+ // echo. Otherwise we clutter the stats with for example cases where only the |
+ // microphone is used. |
+ if (!echo_frames_received_ & !echo_cancellation->stream_has_echo()) |
+ return; |
+ |
+ echo_frames_received_ = true; |
// In WebRTC, three echo delay metrics are calculated and updated every |
// five seconds. We use one of them, |fraction_poor_delays| to log in a UMA |
// histogram an Echo Cancellation quality metric. The stat in WebRTC has a |