summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorcrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 20:01:25 +0000
committercrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-17 20:01:25 +0000
commitabb9efae9c9aec7df42c499025a06ac2524d5322 (patch)
tree10e2c6e65a992f2e3d96aa8acb9e21b9f95fef74 /content
parent35a85c05edb0047a99610f94857d974af1082977 (diff)
downloadchromium_src-abb9efae9c9aec7df42c499025a06ac2524d5322.zip
chromium_src-abb9efae9c9aec7df42c499025a06ac2524d5322.tar.gz
chromium_src-abb9efae9c9aec7df42c499025a06ac2524d5322.tar.bz2
Add support for real-time audio threads.
BUG=none TEST=none (tested locally on Mac OS X) Review URL: http://codereview.chromium.org/6949009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/renderer/audio_device.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/content/renderer/audio_device.cc b/content/renderer/audio_device.cc
index 1940f20..5baa55c 100644
--- a/content/renderer/audio_device.cc
+++ b/content/renderer/audio_device.cc
@@ -207,7 +207,6 @@ void AudioDevice::OnLowLatencyCreated(
// Allow the client to pre-populate the buffer.
FireRenderCallback();
- // TODO(crogers): we could optionally set the thread to high-priority
audio_thread_.reset(
new base::DelegateSimpleThread(this, "renderer_audio_thread"));
audio_thread_->Start();
@@ -224,6 +223,8 @@ void AudioDevice::OnVolume(double volume) {
// Our audio thread runs here.
void AudioDevice::Run() {
+ audio_thread_->SetThreadPriority(base::kThreadPriority_RealtimeAudio);
+
int pending_data;
const int samples_per_ms = static_cast<int>(sample_rate_) / 1000;
const int bytes_per_ms = channels_ * (bits_per_sample_ / 8) * samples_per_ms;