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

Unified Diff: media/audio/audio_input_controller.cc

Issue 2941773002: Added initial muted state to stream creation callback, to avoid races. (Closed)
Patch Set: Added mute information to DoCompleteCreation log message. Created 3 years, 6 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 | « media/audio/audio_input_controller.h ('k') | media/audio/audio_input_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.cc
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc
index e3d994fe64570ee6aa36e90cca0456f80e5bede1..c048bf3b44abc72816e99aab51817f5824a2e79d 100644
--- a/media/audio/audio_input_controller.cc
+++ b/media/audio/audio_input_controller.cc
@@ -359,11 +359,11 @@ void AudioInputController::DoCreateForStream(
// Finally, keep the stream pointer around, update the state and notify.
stream_ = stream_to_control;
- handler_->OnCreated(this);
- // Check the current muted state and start the repeating timer to keep that
- // updated.
- CheckMutedState();
+ // Send initial muted state along with OnCreated, to avoid races.
+ is_muted_ = stream_->IsMuted();
+ handler_->OnCreated(this, is_muted_);
+
check_muted_state_timer_.Start(
FROM_HERE, base::TimeDelta::FromSeconds(kCheckMutedStateIntervalSeconds),
this, &AudioInputController::CheckMutedState);
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | media/audio/audio_input_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698