Commit de1e8a41 authored by mcasas@chromium.org's avatar mcasas@chromium.org

Syntax correction in audio_manager_mac.cc

BUG=367190

Review URL: https://codereview.chromium.org/250803008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266528 0039d316-1c4b-4281-b951-d872f2087c98
parent 21d14e47
...@@ -307,18 +307,15 @@ bool AudioManagerMac::HasAudioInputDevices() { ...@@ -307,18 +307,15 @@ bool AudioManagerMac::HasAudioInputDevices() {
// TODO(xians): There are several places on the OSX specific code which // TODO(xians): There are several places on the OSX specific code which
// could benefit from these helper functions. // could benefit from these helper functions.
bool AudioManagerMac::GetDefaultInputDevice( bool AudioManagerMac::GetDefaultInputDevice(AudioDeviceID* device) {
AudioDeviceID* device) {
return GetDefaultDevice(device, true); return GetDefaultDevice(device, true);
} }
bool AudioManagerMac::GetDefaultOutputDevice( bool AudioManagerMac::GetDefaultOutputDevice(AudioDeviceID* device) {
AudioDeviceID* device) {
return GetDefaultDevice(device, false); return GetDefaultDevice(device, false);
} }
bool AudioManagerMac::GetDefaultDevice( bool AudioManagerMac::GetDefaultDevice(AudioDeviceID* device, bool input) {
AudioDeviceID* device, bool input) {
CHECK(device); CHECK(device);
// Obtain the current output device selected by the user. // Obtain the current output device selected by the user.
...@@ -329,9 +326,7 @@ bool AudioManagerMac::GetDefaultDevice( ...@@ -329,9 +326,7 @@ bool AudioManagerMac::GetDefaultDevice(
pa.mElement = kAudioObjectPropertyElementMaster; pa.mElement = kAudioObjectPropertyElementMaster;
UInt32 size = sizeof(*device); UInt32 size = sizeof(*device);
OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject,
OSStatus result = AudioObjectGetPropertyData(
kAudioObjectSystemObject,
&pa, &pa,
0, 0,
0, 0,
...@@ -346,19 +341,14 @@ bool AudioManagerMac::GetDefaultDevice( ...@@ -346,19 +341,14 @@ bool AudioManagerMac::GetDefaultDevice(
return true; return true;
} }
bool AudioManagerMac::GetDefaultOutputChannels( bool AudioManagerMac::GetDefaultOutputChannels(int* channels) {
int* channels) {
AudioDeviceID device; AudioDeviceID device;
if (!GetDefaultOutputDevice(&device)) if (!GetDefaultOutputDevice(&device))
return false; return false;
return GetDeviceChannels(device, kAudioDevicePropertyScopeOutput, channels);
return GetDeviceChannels(device,
kAudioDevicePropertyScopeOutput,
channels);
} }
bool AudioManagerMac::GetDeviceChannels( bool AudioManagerMac::GetDeviceChannels(AudioDeviceID device,
AudioDeviceID device,
AudioObjectPropertyScope scope, AudioObjectPropertyScope scope,
int* channels) { int* channels) {
CHECK(channels); CHECK(channels);
...@@ -379,13 +369,7 @@ bool AudioManagerMac::GetDeviceChannels( ...@@ -379,13 +369,7 @@ bool AudioManagerMac::GetDeviceChannels(
AudioBufferList& buffer_list = AudioBufferList& buffer_list =
*reinterpret_cast<AudioBufferList*>(list_storage.get()); *reinterpret_cast<AudioBufferList*>(list_storage.get());
result = AudioObjectGetPropertyData( result = AudioObjectGetPropertyData(device, &pa, 0, 0, &size, &buffer_list);
device,
&pa,
0,
0,
&size,
&buffer_list);
if (result != noErr) if (result != noErr)
return false; return false;
...@@ -412,8 +396,7 @@ int AudioManagerMac::HardwareSampleRateForDevice(AudioDeviceID device_id) { ...@@ -412,8 +396,7 @@ int AudioManagerMac::HardwareSampleRateForDevice(AudioDeviceID device_id) {
kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster kAudioObjectPropertyElementMaster
}; };
OSStatus result = AudioObjectGetPropertyData( OSStatus result = AudioObjectGetPropertyData(device_id,
device_id,
&kNominalSampleRateAddress, &kNominalSampleRateAddress,
0, 0,
0, 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment