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

Unified Diff: media/audio/agc_audio_stream.h

Issue 15688007: Fixes crash in AudioInputVolumeTest.InputVolumeTest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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: media/audio/agc_audio_stream.h
diff --git a/media/audio/agc_audio_stream.h b/media/audio/agc_audio_stream.h
index ebf0da6340a81fcf9fe9f13dfeec9510342591de..f6a376285226e032fae7381111c1a6a97eb650b3 100644
--- a/media/audio/agc_audio_stream.h
+++ b/media/audio/agc_audio_stream.h
@@ -149,7 +149,10 @@ class MEDIA_EXPORT AgcAudioStream : public AudioInterface {
// Range is normalized to [0.0,1.0] or [0.0, 1.5] on Linux.
void QueryAndStoreNewMicrophoneVolume() {
DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(timer_.IsRunning());
+
+ // Avoid updating the volume member if AGC is not running.
+ if (!timer_.IsRunning())
+ return;
// Cach the maximum volume if this is the first time we ask for it.
if (max_volume_ == 0.0)
« 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