Commit 02a436c2 authored by crogers@google.com's avatar crogers@google.com

Fix crash on Mac OS X caused by querying audio stream latency.

BUG=109959
TEST=none
(covered by existing tests and tested locally with built-in audio,
 Metric Halo 2882, and Stanton FinalScratch Firewire devices to
 verify that crashes are fixed)

Incidentally, the stream latency was always reported as zero on the devices I tested,
so removing this code should have no practical impact.
Review URL: https://chromiumcodereview.appspot.com/9310004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120095 0039d316-1c4b-4281-b951-d872f2087c98
parent a21b72d7
......@@ -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(
......
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