[vlc-commits] auhal: check getprop of kAudioDevicePropertyLatency
Thomas Guillem
git at videolan.org
Tue Jul 16 11:55:21 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 16 09:32:26 2019 +0200| [1f46192f33972d1b6d614218b3d0082a829ce478] | committer: Thomas Guillem
auhal: check getprop of kAudioDevicePropertyLatency
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1f46192f33972d1b6d614218b3d0082a829ce478
---
modules/audio_output/auhal.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 58c1305711..4707c3ecba 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1599,9 +1599,12 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
/* get device latency */
UInt32 i_latency_samples;
- AO_GET1PROP(p_sys->i_selected_dev, UInt32, &i_latency_samples,
- kAudioDevicePropertyLatency, kAudioObjectPropertyScopeOutput);
- vlc_tick_t i_latency_us = vlc_tick_from_samples(i_latency_samples, fmt->i_rate);
+ vlc_tick_t i_latency_us = 0;
+ int ret = AO_GET1PROP(p_sys->i_selected_dev, UInt32, &i_latency_samples,
+ kAudioDevicePropertyLatency,
+ kAudioObjectPropertyScopeOutput);
+ if (ret == VLC_SUCCESS)
+ i_latency_us += vlc_tick_from_samples(i_latency_samples, fmt->i_rate);
msg_Dbg(p_aout, "Current device has a latency of %lld us", i_latency_us);
More information about the vlc-commits
mailing list