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

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

Issue 14244005: Resolves "Huge increase in audio latency on Windows following r192046" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 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/audio_manager_win.cc
diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc
index 4ada0a17778365676607dbcb3acd84df43a87f03..880fac35e012fb5109b8abd64371e959249a3952 100644
--- a/media/audio/win/audio_manager_win.cc
+++ b/media/audio/win/audio_manager_win.cc
@@ -390,14 +390,21 @@ AudioParameters AudioManagerWin::GetPreferredOutputStreamParameters(
}
if (input_params.IsValid()) {
- if (CoreAudioUtil::IsSupported() &&
- CoreAudioUtil::IsChannelLayoutSupported(eRender, eConsole,
- input_params.channel_layout())) {
- // Open up using the same channel layout as the source if it is
- // supported by the hardware.
- channel_layout = input_params.channel_layout();
- VLOG(1) << "Hardware channel layout is not used; using same "
- << "layout as the source instead (" << channel_layout << ")";
+ if (CoreAudioUtil::IsSupported()) {
+ // Check if it is possible to open up at the specified input channel
DaleCurtis 2013/04/15 18:08:57 Indent is wrong; should be 2 spaces.
henrika (OOO until Aug 14) 2013/04/15 20:28:28 Will fix.
henrika (OOO until Aug 14) 2013/04/16 09:04:35 Done.
+ // layout but avoid checking if the specified layout is the same as the
+ // hardware (preferred) layout. We do this extra check to avoid the
+ // CoreAudioUtil::IsChannelLayoutSupported() overhead in most cases.
+ if (input_params.channel_layout() != channel_layout) {
DaleCurtis 2013/04/15 18:08:57 In the Exclusive mode case, channel_layout won't b
henrika (OOO until Aug 14) 2013/04/15 20:28:28 Can you elaborate. Do you want me to add a flag-ch
DaleCurtis 2013/04/15 20:31:07 In the HasSwitch() block above, I'd just add a: i
henrika (OOO until Aug 14) 2013/04/16 09:04:35 Done.
+ if (CoreAudioUtil::IsChannelLayoutSupported(eRender, eConsole,
+ input_params.channel_layout())) {
DaleCurtis 2013/04/15 18:08:57 Wrong indent; you can't partially wrap some of the
henrika (OOO until Aug 14) 2013/04/15 20:28:28 Will fix.
henrika (OOO until Aug 14) 2013/04/16 09:04:35 Done.
+ // Open up using the same channel layout as the source if it is
+ // supported by the hardware.
+ channel_layout = input_params.channel_layout();
+ VLOG(1) << "Hardware channel layout is not used; using same layout"
+ << " as the source instead (" << channel_layout << ")";
+ }
+ }
}
input_channels = input_params.input_channels();
if (use_input_params) {
« 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