Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Unified Diff: media/audio/mac/audio_manager_mac.cc

Issue 210009: AudioHardwareGetProperty is deprecated in Mac OS X 10.6 ("Snow Leopard") (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_manager_mac.cc
===================================================================
--- media/audio/mac/audio_manager_mac.cc (revision 26448)
+++ media/audio/mac/audio_manager_mac.cc (working copy)
@@ -10,11 +10,21 @@
#include "media/audio/mac/audio_output_mac.h"
bool AudioManagerMac::HasAudioDevices() {
- AudioDeviceID output_device_id = 0;
- size_t size = sizeof(output_device_id);
- OSStatus err = AudioHardwareGetProperty(
- kAudioHardwarePropertyDefaultOutputDevice, &size, &output_device_id);
- return ((err == noErr) && (output_device_id > 0));
+ AudioDeviceID output_device_id = kAudioObjectUnknown;
+ AudioObjectPropertyAddress property_address = {
+ kAudioHardwarePropertyDefaultOutputDevice, // mSelector
+ kAudioObjectPropertyScopeGlobal, // mScope
+ kAudioObjectPropertyElementMaster // mElement
+ };
+ size_t output_device_id_size = sizeof(output_device_id);
+ OSStatus err = AudioObjectGetPropertyData(kAudioObjectSystemObject,
+ &property_address,
+ 0, // inQualifierDataSize
+ NULL, // inQualifierData
+ &output_device_id_size,
+ &output_device_id);
+ return err == kAudioHardwareNoError &&
+ output_device_id != kAudioObjectUnknown;
}
AudioOutputStream* AudioManagerMac::MakeAudioStream(Format format, int channels,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698