[vlc-commits] coreaudio: move out latency log

Thomas Guillem git at videolan.org
Tue Jul 16 12:09:25 CEST 2019


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 16 07:30:50 2019 +0200| [340062e2cd336870194101a887c9e4cb0a369a6f] | committer: Thomas Guillem

coreaudio: move out latency log

(cherry picked from commit 3f389be6ecde7a6d782603204f85266016d50f3c)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=340062e2cd336870194101a887c9e4cb0a369a6f
---

 modules/audio_output/audiounit_ios.m    | 6 ++++--
 modules/audio_output/auhal.c            | 2 ++
 modules/audio_output/coreaudio_common.c | 3 ---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
index 53c890fc5c..45c18c0d61 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -541,8 +541,10 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
     if (err != noErr)
         ca_LogWarn("failed to set IO mode");
 
-    ret = au_Initialize(p_aout, p_sys->au_unit, fmt, layout,
-                        [p_sys->avInstance outputLatency] * CLOCK_FREQ, NULL);
+    const mtime_t latency_us = [p_sys->avInstance outputLatency] * CLOCK_FREQ;
+    msg_Dbg(p_aout, "Current device has a latency of %lld us", latency_us);
+
+    ret = au_Initialize(p_aout, p_sys->au_unit, fmt, layout, latency_us, NULL);
     if (ret != VLC_SUCCESS)
         goto error;
 
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 22044631c7..34c04f683e 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -1612,6 +1612,8 @@ Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
                 kAudioDevicePropertyLatency, kAudioObjectPropertyScopeOutput);
     mtime_t i_latency_us = i_latency_samples * CLOCK_FREQ / fmt->i_rate;
 
+    msg_Dbg(p_aout, "Current device has a latency of %lld us", i_latency_us);
+
     /* Check for Digital mode or Analog output mode */
     if (do_spdif)
     {
diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index 37f5652170..8d7f33fdf5 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -376,9 +376,6 @@ ca_Initialize(audio_output_t *p_aout, const audio_sample_format_t *fmt,
     p_sys->i_frame_length = fmt->i_frame_length;
     p_sys->chans_to_reorder = 0;
 
-    msg_Dbg(p_aout, "Current device has a latency of %lld us",
-            i_dev_latency_us);
-
     /* TODO VLC can't handle latency higher than 1 seconds */
     if (i_dev_latency_us > 1000000)
     {



More information about the vlc-commits mailing list