diff options
author | wm4 <wm4@nowhere> | 2015-07-06 17:49:28 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-07-06 17:49:28 +0200 |
commit | 7c032bde3e6473902bbda2aea65be4bfb9d68802 (patch) | |
tree | ddfe8e980dae575321de8f34ea8d2b332652315b /audio/out/ao_coreaudio.c | |
parent | a56a7f3e8c7dbed38546f3ddedb0e26353f92e25 (diff) | |
download | mpv-7c032bde3e6473902bbda2aea65be4bfb9d68802.tar.bz2 mpv-7c032bde3e6473902bbda2aea65be4bfb9d68802.tar.xz |
ao_coreaudio: fix device latency, share the code
ao_coreaudio (using AudioUnit) accounted only for part of the latency -
move the code in ao_coreaudio_exclusive to utils, and use that for the
AudioUnit code.
(There's still the question why CoreAudio and AudioUnit require you to
jump through hoops this much, but apparently that's how it is.)
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r-- | audio/out/ao_coreaudio.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 1cf38326a2..c592c0ef84 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -56,12 +56,8 @@ static int64_t ca_get_hardware_latency(struct ao *ao) { &size); CHECK_CA_ERROR("cannot get audio unit latency"); - uint32_t frames = 0; - err = CA_GET_O(p->device, kAudioDevicePropertyLatency, &frames); - CHECK_CA_ERROR("cannot get device latency"); - uint64_t audiounit_latency_us = audiounit_latency_sec * 1e6; - uint64_t device_latency_us = ca_frames_to_us(ao, frames); + uint64_t device_latency_us = ca_get_device_latency_us(ao, p->device); MP_VERBOSE(ao, "audiounit latency [us]: %lld\n", audiounit_latency_us); MP_VERBOSE(ao, "device latency [us]: %lld\n", device_latency_us); |