From b8722d02a37a9c1141ea7ca3391fbe795ff1bc5a Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Sun, 29 May 2022 08:49:50 -0600 Subject: Merge pull request #7781 from crobibero/live-tv-infinite (cherry picked from commit 77c73e241fe1705528e3ffbb42f074c46240b9fb) Signed-off-by: crobibero --- Emby.Server.Implementations/Session/SessionManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Emby.Server.Implementations/Session/SessionManager.cs') diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs index d08fedd11..d25376297 100644 --- a/Emby.Server.Implementations/Session/SessionManager.cs +++ b/Emby.Server.Implementations/Session/SessionManager.cs @@ -329,13 +329,17 @@ namespace Emby.Server.Implementations.Session } /// - public void CloseIfNeeded(SessionInfo session) + public async Task CloseIfNeededAsync(SessionInfo session) { if (!session.SessionControllers.Any(i => i.IsSessionActive)) { var key = GetSessionKey(session.Client, session.DeviceId); _activeConnections.TryRemove(key, out _); + if (!string.IsNullOrEmpty(session.PlayState?.LiveStreamId)) + { + await _mediaSourceManager.CloseLiveStream(session.PlayState.LiveStreamId).ConfigureAwait(false); + } OnSessionEnded(session); } @@ -413,6 +417,7 @@ namespace Emby.Server.Implementations.Session session.PlayState.IsPaused = info.IsPaused; session.PlayState.PositionTicks = info.PositionTicks; session.PlayState.MediaSourceId = info.MediaSourceId; + session.PlayState.LiveStreamId = info.LiveStreamId; session.PlayState.CanSeek = info.CanSeek; session.PlayState.IsMuted = info.IsMuted; session.PlayState.VolumeLevel = info.VolumeLevel; -- cgit v1.2.3