Chromium Code Reviews| 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() { |