3.0.5588.0

This commit is contained in:
Luke Pulverenti 2015-04-20 14:35:33 -04:00
parent 28fa3f91dd
commit 4a864e0e68
2 changed files with 19 additions and 6 deletions

View File

@ -119,7 +119,7 @@ namespace MediaBrowser.Api
{ {
var jobCount = _activeTranscodingJobs.Count; 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 files // Try to allow for some time to kill the ffmpeg processes and delete the partial stream files
if (jobCount > 0) if (jobCount > 0)
@ -396,7 +396,7 @@ namespace MediaBrowser.Api
Logger.Debug("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId); Logger.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> /// <summary>
@ -444,7 +444,7 @@ namespace MediaBrowser.Api
foreach (var job in jobs) foreach (var job in jobs)
{ {
KillTranscodingJob(job, deleteFiles); KillTranscodingJob(job, false, deleteFiles);
} }
} }
@ -452,8 +452,9 @@ namespace MediaBrowser.Api
/// Kills the transcoding job. /// Kills the transcoding job.
/// </summary> /// </summary>
/// <param name="job">The job.</param> /// <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> /// <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(); job.DisposeKillTimer();
@ -503,6 +504,18 @@ namespace MediaBrowser.Api
{ {
DeletePartialStreamFiles(job.Path, job.Type, 0, 1500); 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) private async void DeletePartialStreamFiles(string path, TranscodingJobType jobType, int retryCount, int delayMs)

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.0.*")] //[assembly: AssemblyVersion("3.0.*")]
//[assembly: AssemblyVersion("3.0.5582.4")] [assembly: AssemblyVersion("3.0.5588.0")]