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

Side by Side Diff: media/base/audio_renderer_mixer.cc

Issue 2085603002: Fixing deadlock by removing unnesessary lock in AudioRendererMixer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/audio_renderer_mixer.h" 5 #include "media/base/audio_renderer_mixer.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return; 108 return;
109 } 109 }
110 } 110 }
111 111
112 // An error callback should always exist when called. 112 // An error callback should always exist when called.
113 NOTREACHED(); 113 NOTREACHED();
114 } 114 }
115 115
116 OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() { 116 OutputDeviceInfo AudioRendererMixer::GetOutputDeviceInfo() {
117 DVLOG(1) << __FUNCTION__; 117 DVLOG(1) << __FUNCTION__;
118 base::AutoLock auto_lock(lock_);
119 return audio_sink_->GetOutputDeviceInfo(); 118 return audio_sink_->GetOutputDeviceInfo();
120 } 119 }
121 120
122 int AudioRendererMixer::Render(AudioBus* audio_bus, 121 int AudioRendererMixer::Render(AudioBus* audio_bus,
123 uint32_t frames_delayed, 122 uint32_t frames_delayed,
124 uint32_t frames_skipped) { 123 uint32_t frames_skipped) {
125 base::AutoLock auto_lock(lock_); 124 base::AutoLock auto_lock(lock_);
126 125
127 // If there are no mixer inputs and we haven't seen one for a while, pause the 126 // If there are no mixer inputs and we haven't seen one for a while, pause the
128 // sink to avoid wasting resources when media elements are present but remain 127 // sink to avoid wasting resources when media elements are present but remain
(...skipping 11 matching lines...) Expand all
140 } 139 }
141 140
142 void AudioRendererMixer::OnRenderError() { 141 void AudioRendererMixer::OnRenderError() {
143 // Call each mixer input and signal an error. 142 // Call each mixer input and signal an error.
144 base::AutoLock auto_lock(lock_); 143 base::AutoLock auto_lock(lock_);
145 for (const auto& cb : error_callbacks_) 144 for (const auto& cb : error_callbacks_)
146 cb.Run(); 145 cb.Run();
147 } 146 }
148 147
149 } // namespace media 148 } // namespace media
OLDNEW
« 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