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) { |