From 7ce911a40145fce2600ba3ce042b82f7cb97d7f7 Mon Sep 17 00:00:00 2001
From: fmarcac <188743521+fmarcac@users.noreply.github.com>
Date: Sat, 5 Sep 2026 15:06:37 +0200
Subject: Clamp client reported ping in SyncPlay groups
---
Emby.Server.Implementations/SyncPlay/Group.cs | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'Emby.Server.Implementations')
diff --git a/Emby.Server.Implementations/SyncPlay/Group.cs b/Emby.Server.Implementations/SyncPlay/Group.cs
index 256faffbf4..923bfc67aa 100644
--- a/Emby.Server.Implementations/SyncPlay/Group.cs
+++ b/Emby.Server.Implementations/SyncPlay/Group.cs
@@ -90,6 +90,18 @@ namespace Emby.Server.Implementations.SyncPlay
/// The default ping.
public long DefaultPing { get; } = 500;
+ ///
+ /// Gets the maximum ping, in milliseconds, accepted from a session.
+ ///
+ ///
+ /// Pings are reported by clients and are scaled into the delays used to schedule playback,
+ /// so an unbounded value lets a single session push the whole group's resume point
+ /// arbitrarily far out, or overflow the arithmetic entirely. Anything above this is not a
+ /// usable measurement for synchronisation.
+ ///
+ /// The maximum ping.
+ public long MaxPing { get; } = 10000;
+
///
/// Gets the maximum time offset error accepted for dates reported by clients, in milliseconds.
///
@@ -438,7 +450,7 @@ namespace Emby.Server.Implementations.SyncPlay
{
if (_participants.TryGetValue(session.Id, out GroupMember value))
{
- value.Ping = ping;
+ value.Ping = Math.Clamp(ping, 0, MaxPing);
}
}
--
cgit v1.2.3