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

Unified Diff: media/audio/mac/audio_manager_mac.cc

Issue 12387006: Pass more detailed audio hardware configuration information to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
Index: media/audio/mac/audio_manager_mac.cc
===================================================================
--- media/audio/mac/audio_manager_mac.cc (revision 186233)
+++ media/audio/mac/audio_manager_mac.cc (working copy)
@@ -336,7 +336,8 @@
AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
const AudioParameters& input_params) {
- ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO;
+ ChannelLayout channel_layout = CHANNEL_LAYOUT_UNSUPPORTED;
+
int input_channels = 0;
if (input_params.IsValid()) {
channel_layout = input_params.channel_layout();
DaleCurtis 2013/03/06 19:19:30 Instead of doing this I think you should use FFmpe
Chris Rogers 2013/03/07 00:34:17 I think I've changed it to be more in line with yo
@@ -352,10 +353,24 @@
}
}
- return AudioParameters(
- AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, input_channels,
- AUAudioOutputStream::HardwareSampleRate(), 16,
+ AudioParameters params(
+ AudioParameters::AUDIO_PCM_LOW_LATENCY,
+ channel_layout,
+ input_channels,
+ AUAudioOutputStream::HardwareSampleRate(),
+ 16,
kDefaultLowLatencyBufferSize);
+
+ if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) {
+ int channels = 2;
+ int channels_per_frame;
+ AudioHardwareUnifiedStream::GetDefaultOutputChannels(
+ &channels, &channels_per_frame);
DaleCurtis 2013/03/06 19:19:30 4 space indent.
Chris Rogers 2013/03/07 00:34:17 Done.
+
+ params.SetDiscreteChannels(channels);
+ }
+
+ return params;
}
void AudioManagerMac::CreateDeviceListener() {

Powered by Google App Engine
This is Rietveld 408576698