mirror of
https://github.com/Shik3i/KoalaSync.git
synced 2026-09-01 21:47:58 +00:00
Optimize network latency compensation cap to protect against system clock skew
This commit is contained in:
@@ -388,7 +388,7 @@
|
|||||||
const video = findVideo();
|
const video = findVideo();
|
||||||
if (video && message.actionTimestamp) {
|
if (video && message.actionTimestamp) {
|
||||||
const latency = (Date.now() - message.actionTimestamp) / 1000;
|
const latency = (Date.now() - message.actionTimestamp) / 1000;
|
||||||
if (latency > 0.05 && latency < 5.0) {
|
if (latency > 0.05 && latency < 1.0) {
|
||||||
_setSuppress('seek');
|
_setSuppress('seek');
|
||||||
video.currentTime += latency;
|
video.currentTime += latency;
|
||||||
reportLog(`Force Sync: Compensated ${Math.round(latency * 1000)}ms network latency`, 'info');
|
reportLog(`Force Sync: Compensated ${Math.round(latency * 1000)}ms network latency`, 'info');
|
||||||
|
|||||||
Reference in New Issue
Block a user