From 193f2c676d36fa6fe952463a68398e0464177830 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 21 Aug 2015 21:50:33 -0700 Subject: [PATCH] GUAC-427: Adjust for audio latency, compensating for underflow. --- guacamole-common-js/src/main/webapp/modules/AudioChannel.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guacamole-common-js/src/main/webapp/modules/AudioChannel.js b/guacamole-common-js/src/main/webapp/modules/AudioChannel.js index a18060636..8fe38e2e1 100644 --- a/guacamole-common-js/src/main/webapp/modules/AudioChannel.js +++ b/guacamole-common-js/src/main/webapp/modules/AudioChannel.js @@ -58,8 +58,10 @@ Guacamole.AudioChannel = function() { var now = Guacamole.AudioChannel.getTimestamp(); // If underflow is detected, reschedule new packets relative to now. - if (next_packet_time < now) + if (next_packet_time < now) { + duration += next_packet_time - now; next_packet_time = now; + } // Schedule next packet packet.play(next_packet_time);