diff options
Diffstat (limited to 'MediaBrowser.Api/ApiEntryPoint.cs')
| -rw-r--r-- | MediaBrowser.Api/ApiEntryPoint.cs | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index a21fc22fe..a6958b95d 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -274,32 +274,37 @@ namespace MediaBrowser.Api return null; } - job.ActiveRequestCount++; - - job.DisposeKillTimer(); + OnTranscodeBeginRequest(job); return job; } } + public void OnTranscodeBeginRequest(TranscodingJob job) + { + job.ActiveRequestCount++; + + job.DisposeKillTimer(); + } + public void OnTranscodeEndRequest(TranscodingJob job) { job.ActiveRequestCount--; if (job.ActiveRequestCount == 0) { - if (job.Type == TranscodingJobType.Progressive) - { - const int timerDuration = 1000; + // TODO: Lower this hls timeout + var timerDuration = job.Type == TranscodingJobType.Progressive ? + 1000 : + 14400000; - if (job.KillTimer == null) - { - job.KillTimer = new Timer(OnTranscodeKillTimerStopped, job, timerDuration, Timeout.Infinite); - } - else - { - job.KillTimer.Change(timerDuration, Timeout.Infinite); - } + if (job.KillTimer == null) + { + job.KillTimer = new Timer(OnTranscodeKillTimerStopped, job, timerDuration, Timeout.Infinite); + } + else + { + job.KillTimer.Change(timerDuration, Timeout.Infinite); } } } @@ -498,7 +503,7 @@ namespace MediaBrowser.Api .ToList(); Exception e = null; - + foreach (var file in filesToDelete) { try |
