Chromium Code Reviews| Index: media/audio/mac/audio_manager_mac.cc |
| diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc |
| index 21b931809a5333e89595deae95be058455791d6f..64c93c641db68f3b20be2533b814904edebe92db 100644 |
| --- a/media/audio/mac/audio_manager_mac.cc |
| +++ b/media/audio/mac/audio_manager_mac.cc |
| @@ -81,6 +81,8 @@ bool AudioManagerMac::HasUnifiedDefaultIO() { |
| return input_id == output_id; |
| } |
| +// Retrieves information on audio devices, and prepends the default |
| +// device to the list if the list is non-empty. |
| static void GetAudioDeviceInfo(bool is_input, |
| media::AudioDeviceNames* device_names) { |
| // Query the number of total devices. |
| @@ -173,6 +175,16 @@ static void GetAudioDeviceInfo(bool is_input, |
| if (name) |
| CFRelease(name); |
| } |
| + |
| + if (!device_names->empty()) { |
| + // Prepend the default device to the list since we always want it to be |
| + // on the top of the list for all platforms. There is no duplicate |
| + // counting here since the default device has been abstracted out before. |
| + media::AudioDeviceName name; |
| + name.device_name = AudioManagerBase::kDefaultDeviceName; |
| + name.unique_id = AudioManagerBase::kDefaultDeviceId; |
|
tommi (sloooow) - chröme
2013/09/09 16:09:23
nit: one space after =
Jói
2013/09/09 16:15:44
Done.
|
| + device_names->push_front(name); |
| + } |
| } |
| static AudioDeviceID GetAudioDeviceIdByUId(bool is_input, |
| @@ -396,15 +408,12 @@ void AudioManagerMac::GetAudioInputDeviceNames( |
| media::AudioDeviceNames* device_names) { |
| DCHECK(device_names->empty()); |
| GetAudioDeviceInfo(true, device_names); |
| - if (!device_names->empty()) { |
| - // Prepend the default device to the list since we always want it to be |
| - // on the top of the list for all platforms. There is no duplicate |
| - // counting here since the default device has been abstracted out before. |
| - media::AudioDeviceName name; |
| - name.device_name = AudioManagerBase::kDefaultDeviceName; |
| - name.unique_id = AudioManagerBase::kDefaultDeviceId; |
| - device_names->push_front(name); |
| - } |
| +} |
| + |
| +void AudioManagerMac::GetAudioOutputDeviceNames( |
| + media::AudioDeviceNames* device_names) { |
| + DCHECK(device_names->empty()); |
| + GetAudioDeviceInfo(false, device_names); |
| } |
| AudioParameters AudioManagerMac::GetInputStreamParameters( |