diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2020-10-17 09:47:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-17 09:47:20 +0100 |
| commit | 38da2ee26efb45ab8afc8aa692686ffe316a4ace (patch) | |
| tree | 6b5a05b7a437bbb53da78062e869daa220a51762 /Emby.Server.Implementations/SyncPlay/SyncPlayController.cs | |
| parent | ee976bb47abe2f16b7d27cd2f789264c5a9ec8d0 (diff) | |
| parent | 86090ab1f65c66958c897cacd04221c537053eb3 (diff) | |
Merge branch 'master' into update-plugin
Diffstat (limited to 'Emby.Server.Implementations/SyncPlay/SyncPlayController.cs')
| -rw-r--r-- | Emby.Server.Implementations/SyncPlay/SyncPlayController.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs index 80b977731..538479512 100644 --- a/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs +++ b/Emby.Server.Implementations/SyncPlay/SyncPlayController.cs @@ -301,8 +301,7 @@ namespace Emby.Server.Implementations.SyncPlay if (_group.IsPaused) { // Pick a suitable time that accounts for latency - var delay = _group.GetHighestPing() * 2; - delay = delay < _group.DefaultPing ? _group.DefaultPing : delay; + var delay = Math.Max(_group.GetHighestPing() * 2, GroupInfo.DefaultPing); // Unpause group and set starting point in future // Clients will start playback at LastActivity (datetime) from PositionTicks (playback position) @@ -452,8 +451,7 @@ namespace Emby.Server.Implementations.SyncPlay else { // Client, that was buffering, resumed playback but did not update others in time - delay = _group.GetHighestPing() * 2; - delay = delay < _group.DefaultPing ? _group.DefaultPing : delay; + delay = Math.Max(_group.GetHighestPing() * 2, GroupInfo.DefaultPing); _group.LastActivity = currentTime.AddMilliseconds( delay); @@ -497,7 +495,7 @@ namespace Emby.Server.Implementations.SyncPlay private void HandlePingUpdateRequest(SessionInfo session, PlaybackRequest request) { // Collected pings are used to account for network latency when unpausing playback - _group.UpdatePing(session, request.Ping ?? _group.DefaultPing); + _group.UpdatePing(session, request.Ping ?? GroupInfo.DefaultPing); } /// <inheritdoc /> |
