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

David Fuhrmann git at videolan.org
Wed Sep 23 21:57:24 CEST 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Sep 23 21:49:40 2015 +0200| [6f54a7591c7a257cc5cb53c0c03e47e974faa279] | 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

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

 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 5dc14f5..8b60ac0 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