diff options
author | crogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-07 01:20:26 +0000 |
---|---|---|
committer | crogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-07 01:20:26 +0000 |
commit | bd61f014feb71a4bd6c25638ad4e877f04cb370f (patch) | |
tree | adde385bbfc102b7b629ea730697c002ffaf3b45 | |
parent | 02c747ae186c7792f5076e3a673c0ca32e63972c (diff) | |
download | chromium_src-bd61f014feb71a4bd6c25638ad4e877f04cb370f.zip chromium_src-bd61f014feb71a4bd6c25638ad4e877f04cb370f.tar.gz chromium_src-bd61f014feb71a4bd6c25638ad4e877f04cb370f.tar.bz2 |
Merge 120095 - Fix crash on Mac OS X caused by querying audio stream latency.
BUG=109959
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9351005
git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@120675 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | media/audio/mac/audio_low_latency_output_mac.cc | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/media/audio/mac/audio_low_latency_output_mac.cc b/media/audio/mac/audio_low_latency_output_mac.cc index f600e5f..f6fabde 100644 --- a/media/audio/mac/audio_low_latency_output_mac.cc +++ b/media/audio/mac/audio_low_latency_output_mac.cc @@ -328,39 +328,8 @@ double AUAudioOutputStream::GetHardwareLatency() { OSSTATUS_DLOG_IF(WARNING, result != noErr, result) << "Could not get audio device latency"; - // Get the stream latency. - property_address.mSelector = kAudioDevicePropertyStreams; - UInt32 stream_latency_frames = 0; - result = AudioObjectGetPropertyDataSize(output_device_id_, - &property_address, - 0, - NULL, - &size); - if (!result) { - scoped_ptr_malloc<AudioStreamID> - streams(reinterpret_cast<AudioStreamID*>(malloc(size))); - AudioStreamID* stream_ids = streams.get(); - result = AudioObjectGetPropertyData(output_device_id_, - &property_address, - 0, - NULL, - &size, - stream_ids); - if (!result) { - property_address.mSelector = kAudioStreamPropertyLatency; - result = AudioObjectGetPropertyData(stream_ids[0], - &property_address, - 0, - NULL, - &size, - &stream_latency_frames); - } - } - OSSTATUS_DLOG_IF(WARNING, result != noErr, result) - << "Could not get audio stream latency"; - return static_cast<double>((audio_unit_latency_sec * - format_.mSampleRate) + device_latency_frames + stream_latency_frames); + format_.mSampleRate) + device_latency_frames); } double AUAudioOutputStream::GetPlayoutLatency( |