From b8d4ef5fc6a1d042c8521265b50ef60eaa492e68 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 12 Jul 2017 14:54:46 -0400 Subject: [PATCH] add session reporting error handling --- MediaBrowser.Api/Playback/Hls/VideoHlsService.cs | 10 ++++++++++ MediaBrowser.Controller/Session/SessionInfo.cs | 14 ++++++++++++++ SharedVersion.cs | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index e32970be5..d11e6f215 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -75,6 +75,16 @@ namespace MediaBrowser.Api.Playback.Hls /// System.String. protected override string GetVideoArguments(StreamState state) { + if (!state.IsOutputVideo) + { + return string.Empty; + } + // No known video stream + if (state.VideoStream == null) + { + return string.Empty; + } + var codec = EncodingHelper.GetVideoEncoder(state, ApiEntryPoint.Instance.GetEncodingOptions()); var args = "-codec:v:0 " + codec; diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs index f590d9aec..11a9ceac4 100644 --- a/MediaBrowser.Controller/Session/SessionInfo.cs +++ b/MediaBrowser.Controller/Session/SessionInfo.cs @@ -203,6 +203,11 @@ namespace MediaBrowser.Controller.Session public void StartAutomaticProgress(ITimerFactory timerFactory, PlaybackProgressInfo progressInfo) { + if (_disposed) + { + return; + } + lock (_progressLock) { _lastProgressInfo = progressInfo; @@ -223,6 +228,11 @@ namespace MediaBrowser.Controller.Session private async void OnProgressTimerCallback(object state) { + if (_disposed) + { + return; + } + var progressInfo = _lastProgressInfo; if (progressInfo == null) { @@ -274,8 +284,12 @@ namespace MediaBrowser.Controller.Session } } + private bool _disposed = false; + public void Dispose() { + _disposed = true; + StopAutomaticProgress(); _sessionManager = null; } diff --git a/SharedVersion.cs b/SharedVersion.cs index 42b8a9abb..82630841c 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.24.1")] +[assembly: AssemblyVersion("3.2.25.2")]