[vlc-commits] auhal: do not add long latency to time_get callback

David Fuhrmann git at videolan.org
Wed Sep 23 22:04:25 CEST 2015


vlc/vlc-2.2 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Sep 23 21:49:40 2015 +0200| [a230056b338d2739f09a87d2542596a80080405c] | committer: David Fuhrmann

auhal: do not add long latency to time_get callback

Currently, the VLC code cannot cope with big audio device
latencies as reported by airplay devices. Thus disable the
latency calculation for those devices for now.

refs #14042

(cherry picked from commit 6f54a7591c7a257cc5cb53c0c03e47e974faa279)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=a230056b338d2739f09a87d2542596a80080405c
---

 modules/audio_output/auhal.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 10459f0..39a479e 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -441,8 +441,14 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
         msg_Warn(p_aout, "Cannot get device latency [%4.4s]",
                  (char *)&err);
     }
-    msg_Dbg(p_aout, "Current device has a latency of %u frames", p_sys->i_device_latency);
+    float f_latency_in_sec = (float)p_sys->i_device_latency / (float)fmt->i_rate;
+    msg_Dbg(p_aout, "Current device has a latency of %u frames (%f sec)", p_sys->i_device_latency, f_latency_in_sec);
 
+    // Ignore long Airplay latency as this is not correctly working yet
+    if (f_latency_in_sec > 0.5f) {
+        msg_Info(p_aout, "Ignore high latency as it causes problems currently.");
+        p_sys->i_device_latency = 0;
+    }
 
     bool b_success = false;
 



More information about the vlc-commits mailing list