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

Unified Diff: media/audio/win/waveout_output_win.cc

Issue 11316284: Boost WaveOut thread priority for background audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typo. Created 8 years, 1 month 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/win/waveout_output_win.cc
diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc
index f18b2fa4287dc59c01ed21596f6c6fbb07d28c18..48f41e18f976e3be69015cb385bcae295b0131fc 100644
--- a/media/audio/win/waveout_output_win.cc
+++ b/media/audio/win/waveout_output_win.cc
@@ -11,6 +11,8 @@
#include "base/basictypes.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
+#include "base/message_loop_proxy.h"
+#include "base/threading/platform_thread.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_util.h"
#include "media/audio/win/audio_manager_win.h"
@@ -108,6 +110,11 @@ PCMWaveOutAudioOutputStream::PCMWaveOutAudioOutputStream(
}
format_.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
format_.Samples.wValidBitsPerSample = params.bits_per_sample();
+
+ // Boost thread priority. Required for glitch free background audio.
scherkus (not reviewing) 2012/11/30 22:13:34 which thread is this? the OS callback thread or a
henrika (OOO until Aug 14) 2012/12/03 08:35:43 Same question as Andrew.
DaleCurtis 2012/12/03 18:11:06 Henrik, please see the old messages for full discu
+ DCHECK(manager_->GetMessageLoop()->BelongsToCurrentThread());
+ base::PlatformThread::SetThreadPriority(
+ GetCurrentThread(), base::kThreadPriority_RealtimeAudio);
}
PCMWaveOutAudioOutputStream::~PCMWaveOutAudioOutputStream() {
« 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