The Free Software Media System - Server Backend & API
3.0.5588.0
Luke Pulverenti4a864e0e6844
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.csindex e76dcb4a48..55aa778e2f 100644--- a/MediaBrowser.Api/ApiEntryPoint.cs+++ b/MediaBrowser.Api/ApiEntryPoint.cs@@ -119,7 +119,7 @@ namespace MediaBrowser.Api{var jobCount = _activeTranscodingJobs.Count;- Parallel.ForEach(_activeTranscodingJobs.ToList(), j => KillTranscodingJob(j, path => true));+ Parallel.ForEach(_activeTranscodingJobs.ToList(), j => KillTranscodingJob(j, false, path => true));// Try to allow for some time to kill the ffmpeg processes and delete the partial stream filesif (jobCount > 0)@@ -396,7 +396,7 @@ namespace MediaBrowser.ApiLogger.Debug("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId);- KillTranscodingJob(job, path => true);+ KillTranscodingJob(job, true, path => true);}/// <summary>@@ -444,7 +444,7 @@ namespace MediaBrowser.Apiforeach (var job in jobs){- KillTranscodingJob(job, deleteFiles);+ KillTranscodingJob(job, false, deleteFiles);}}@@ -452,8 +452,9 @@ namespace MediaBrowser.Api/// Kills the transcoding job./// </summary>/// <param name="job">The job.</param>+ /// <param name="closeLiveStream">if set to <c>true</c> [close live stream].</param>/// <param name="delete">The delete.</param>- private void KillTranscodingJob(TranscodingJob job, Func<string, bool> delete)+ private async void KillTranscodingJob(TranscodingJob job, bool closeLiveStream, Func<string, bool> delete){job.DisposeKillTimer();@@ -503,6 +504,18 @@ namespace MediaBrowser.Api{DeletePartialStreamFiles(job.Path, job.Type, 0, 1500);}++ if (closeLiveStream && !string.IsNullOrWhiteSpace(job.LiveStreamId))+ {+ try+ {+ await _mediaSourceManager.CloseLiveStream(job.LiveStreamId, CancellationToken.None).ConfigureAwait(false);+ }+ catch (Exception ex)+ {+ Logger.ErrorException("Error closing live stream for {0}", ex, job.Path);+ }+ }}private async void DeletePartialStreamFiles(string path, TranscodingJobType jobType, int retryCount, int delayMs)diff --git a/SharedVersion.cs b/SharedVersion.csindex d83c542d13..49945f62ac 100644--- a/SharedVersion.cs+++ b/SharedVersion.cs@@ -1,4 +1,4 @@using System.Reflection;-[assembly: AssemblyVersion("3.0.*")]-//[assembly: AssemblyVersion("3.0.5582.4")]+//[assembly: AssemblyVersion("3.0.*")]+[assembly: AssemblyVersion("3.0.5588.0")]