Commit 06def691 authored by dalecurtis's avatar dalecurtis Committed by Commit bot

Use the worker task runner instead of the main audio thread.

On OSX the main audio thread is the UI thread due to limitations
in the CoreAudio API. Since we're making effectively read only
calls sending the audio hardware config from the worker task
runner should be fine. We already do this in several other places
for device enumeration (since it's way to slow on UI thread).

BUG=469737
TEST=none

Review URL: https://codereview.chromium.org/1029933003

Cr-Commit-Position: refs/heads/master@{#322292}
parent 9ed27ee0
...@@ -213,7 +213,7 @@ void RemoveShaderInfo(int32 id) { ...@@ -213,7 +213,7 @@ void RemoveShaderInfo(int32 id) {
scoped_ptr<IPC::Message> SendAudioHardwareConfig() { scoped_ptr<IPC::Message> SendAudioHardwareConfig() {
media::AudioManager* am = media::AudioManager::Get(); media::AudioManager* am = media::AudioManager::Get();
DCHECK(am->GetTaskRunner()->BelongsToCurrentThread()); DCHECK(am->GetWorkerTaskRunner()->BelongsToCurrentThread());
return make_scoped_ptr(new ViewMsg_SetAudioHardwareConfig( return make_scoped_ptr(new ViewMsg_SetAudioHardwareConfig(
am->GetDefaultOutputStreamParameters(), am->GetDefaultOutputStreamParameters(),
am->GetInputStreamParameters(media::AudioManagerBase::kDefaultDeviceId))); am->GetInputStreamParameters(media::AudioManagerBase::kDefaultDeviceId)));
...@@ -2338,7 +2338,7 @@ void RenderProcessHostImpl::OnProcessLaunched() { ...@@ -2338,7 +2338,7 @@ void RenderProcessHostImpl::OnProcessLaunched() {
} }
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
media::AudioManager::Get()->GetTaskRunner().get(), FROM_HERE, media::AudioManager::Get()->GetWorkerTaskRunner().get(), FROM_HERE,
base::Bind(&SendAudioHardwareConfig), base::Bind(&SendAudioHardwareConfig),
base::Bind(base::IgnoreResult(&RenderProcessHostImpl::SendHelper), base::Bind(base::IgnoreResult(&RenderProcessHostImpl::SendHelper),
weak_factory_.GetWeakPtr())); weak_factory_.GetWeakPtr()));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment