diff options
| author | fmarcac <188743521+fmarcac@users.noreply.github.com> | 2026-09-05 15:06:37 +0200 |
|---|---|---|
| committer | fmarcac <188743521+fmarcac@users.noreply.github.com> | 2026-09-05 15:06:37 +0200 |
| commit | 7ce911a40145fce2600ba3ce042b82f7cb97d7f7 (patch) | |
| tree | 5c5b24f8a3b7c0720d1e8d4a566d51c3154ad8d8 /Emby.Server.Implementations | |
| parent | e356fe9146bb4c62226e9c5108bfa9bf17171f68 (diff) | |
Clamp client reported ping in SyncPlay groups
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/SyncPlay/Group.cs | 14 |
1 files changed, 13 insertions, 1 deletions
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 @@ -91,6 +91,18 @@ namespace Emby.Server.Implementations.SyncPlay public long DefaultPing { get; } = 500; /// <summary> + /// Gets the maximum ping, in milliseconds, accepted from a session. + /// </summary> + /// <remarks> + /// 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. + /// </remarks> + /// <value>The maximum ping.</value> + public long MaxPing { get; } = 10000; + + /// <summary> /// Gets the maximum time offset error accepted for dates reported by clients, in milliseconds. /// </summary> /// <value>The maximum time offset error.</value> @@ -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); } } |
