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

Unified Diff: media/audio/audio_input_device.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_device.h ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_device.cc
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc
index eb31a5723ff53594e1210cbecfa4e74274a38e26..3d6819df89935222db711a18f41974057238738c 100644
--- a/media/audio/audio_input_device.cc
+++ b/media/audio/audio_input_device.cc
@@ -149,11 +149,11 @@ void AudioInputDevice::SetAutomaticGainControl(bool enabled) {
this, enabled));
}
-void AudioInputDevice::OnStreamCreated(
- base::SharedMemoryHandle handle,
- base::SyncSocket::Handle socket_handle,
- int length,
- int total_segments) {
+void AudioInputDevice::OnStreamCreated(base::SharedMemoryHandle handle,
+ base::SyncSocket::Handle socket_handle,
+ int length,
+ int total_segments,
+ bool initially_muted) {
DCHECK(task_runner()->BelongsToCurrentThread());
DCHECK(base::SharedMemory::IsHandleValid(handle));
#if defined(OS_WIN)
@@ -175,6 +175,10 @@ void AudioInputDevice::OnStreamCreated(
DCHECK(!audio_callback_);
DCHECK(!audio_thread_);
+
+ if (initially_muted)
+ callback_->OnCaptureMuted(true);
+
audio_callback_.reset(new AudioInputDevice::AudioThreadCallback(
audio_parameters_, handle, length, total_segments, callback_,
base::BindRepeating(&AudioInputDevice::SetLastCallbackTimeToNow, this)));
« no previous file with comments | « media/audio/audio_input_device.h ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698