Index: media/audio/mac/audio_output_mac.cc |
diff --git a/media/audio/mac/audio_output_mac.cc b/media/audio/mac/audio_output_mac.cc |
index b0784ebe6a776042051fec1bedd95e22b7aec7d2..0e3c744fc6c5760ea15c04d7d6b5fdbc8e5836af 100644 |
--- a/media/audio/mac/audio_output_mac.cc |
+++ b/media/audio/mac/audio_output_mac.cc |
@@ -115,14 +115,10 @@ bool PCMQueueOutAudioOutputStream::Open() { |
} |
// Get the size of the channel layout. |
UInt32 core_layout_size; |
- // TODO(annacc): AudioDeviceGetPropertyInfo() is deprecated, but its |
- // replacement, AudioObjectGetPropertyDataSize(), doesn't work yet with |
- // kAudioDevicePropertyPreferredChannelLayout. |
-#pragma clang diagnostic push |
-#pragma clang diagnostic ignored "-Wdeprecated-declarations" |
- err = AudioDeviceGetPropertyInfo(device_id, 0, false, |
- kAudioDevicePropertyPreferredChannelLayout, |
- &core_layout_size, NULL); |
+ property_address.mSelector = kAudioDevicePropertyPreferredChannelLayout; |
scherkus (not reviewing)
2012/07/31 01:44:21
...but this change would run into the bug on my 10
|
+ property_address.mScope = kAudioDevicePropertyScopeOutput; |
+ err = AudioObjectGetPropertyDataSize(device_id, &property_address, 0, NULL, |
+ &core_layout_size); |
if (err != noErr) { |
HandleError(err); |
return false; |
@@ -133,12 +129,9 @@ bool PCMQueueOutAudioOutputStream::Open() { |
core_channel_layout.reset( |
reinterpret_cast<AudioChannelLayout*>(malloc(core_layout_size))); |
memset(core_channel_layout.get(), 0, core_layout_size); |
- // TODO(annacc): AudioDeviceGetProperty() is deprecated, but its |
- // replacement, AudioObjectGetPropertyData(), doesn't work yet with |
- // kAudioDevicePropertyPreferredChannelLayout. |
- err = AudioDeviceGetProperty(device_id, 0, false, |
- kAudioDevicePropertyPreferredChannelLayout, |
- &core_layout_size, core_channel_layout.get()); |
+ err = AudioObjectGetPropertyData(device_id, &property_address, 0, NULL, |
+ &core_layout_size, |
+ core_channel_layout.get()); |
if (err != noErr) { |
HandleError(err); |
return false; |