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..ef37045d237edc28ad394ad989c4c4f128829d8a 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; |
+ 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( |