summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 19:06:49 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 19:06:49 +0000
commit9c32098368e6df8b1c80c5da20131db25b422d40 (patch)
tree86ddf9f4f2b8d0beea3a46fbf2d779b04afdb3ef /chrome
parentffbdb354dc57a938943478fd391a7cc49b4f8649 (diff)
downloadchromium_src-9c32098368e6df8b1c80c5da20131db25b422d40.zip
chromium_src-9c32098368e6df8b1c80c5da20131db25b422d40.tar.gz
chromium_src-9c32098368e6df8b1c80c5da20131db25b422d40.tar.bz2
AudioController to perform audio operations on a separate thread
Added AudioController as a wrapper over AudioOutputStream to operate methods of AudioOutputStream on a separate thread managed by AudioController. This way most of the audio operations will be non-blocking. Next step is to modify AudioRendererHost to use AudioController. TEST=media_unittests --gtest_filter=AudioControllerTest.* BUG=39885 Review URL: http://codereview.chromium.org/2477005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/audio_renderer_host.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/browser/renderer_host/audio_renderer_host.cc b/chrome/browser/renderer_host/audio_renderer_host.cc
index 0fbc5e6..4d3226c 100644
--- a/chrome/browser/renderer_host/audio_renderer_host.cc
+++ b/chrome/browser/renderer_host/audio_renderer_host.cc
@@ -280,7 +280,7 @@ void AudioRendererHost::IPCAudioSource::Flush() {
if (state_ != kPaused)
return;
- // The following operation is atomic in PushSource so we don't need to lock.
+ AutoLock auto_lock(lock_);
push_source_.ClearAll();
}
@@ -351,10 +351,12 @@ uint32 AudioRendererHost::IPCAudioSource::OnMoreData(AudioOutputStream* stream,
void AudioRendererHost::IPCAudioSource::OnClose(AudioOutputStream* stream) {
// Push source doesn't need to know the stream so just pass in NULL.
- if (!shared_socket_.get())
+ if (!shared_socket_.get()) {
+ AutoLock auto_lock(lock_);
push_source_.OnClose(NULL);
- else
+ } else {
shared_socket_->Close();
+ }
}
void AudioRendererHost::IPCAudioSource::OnError(AudioOutputStream* stream,