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

Unified Diff: media/audio/pulse/pulse_output.cc

Issue 2394483002: Adding syncrhonization to PulseAudioOutputStream::SetVolume (Closed)
Patch Set: Created 4 years, 2 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/pulse/pulse_output.cc
diff --git a/media/audio/pulse/pulse_output.cc b/media/audio/pulse/pulse_output.cc
index 3aef9476720106208a92be3cab41ee5e4df0a81b..b5c2d2efb774f93426e76a9265707b7af423a8a9 100644
--- a/media/audio/pulse/pulse_output.cc
+++ b/media/audio/pulse/pulse_output.cc
@@ -227,6 +227,9 @@ void PulseAudioOutputStream::Stop() {
void PulseAudioOutputStream::SetVolume(double volume) {
DCHECK(thread_checker_.CalledOnValidThread());
+ // Waiting for the main loop lock will ensure outstanding callbacks have
+ // completed and |volume_| is not accessed from them.
+ AutoPulseLock auto_lock(pa_mainloop_);
volume_ = static_cast<float>(volume);
}
« 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