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

Unified Diff: media/base/audio_renderer_mixer_input.h

Issue 1748183006: Add lock to fix race in AudioRendererMixerInput. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo. Created 4 years, 9 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 | media/base/audio_renderer_mixer_input.cc » ('j') | media/base/audio_renderer_mixer_input.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer_input.h
diff --git a/media/base/audio_renderer_mixer_input.h b/media/base/audio_renderer_mixer_input.h
index 34f37c5ee00a3c0d0803ef4f807992942bbf8401..5d9cfc23734d68c9d3622b712210d3a53b9bded0 100644
--- a/media/base/audio_renderer_mixer_input.h
+++ b/media/base/audio_renderer_mixer_input.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/macros.h"
+#include "base/synchronization/lock.h"
#include "media/base/audio_converter.h"
#include "media/base/audio_renderer_sink.h"
#include "media/base/output_device.h"
@@ -69,6 +70,10 @@ class MEDIA_EXPORT AudioRendererMixerInput
private:
friend class AudioRendererMixerInputTest;
+ // Protect |volume_|, accessed by separate threads in ProvideInput() and
+ // SetVolume().
+ base::Lock volume_lock_;
+
bool started_;
bool playing_;
double volume_;
« no previous file with comments | « no previous file | media/base/audio_renderer_mixer_input.cc » ('j') | media/base/audio_renderer_mixer_input.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698