diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-18 00:50:21 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-09-18 00:50:21 -0400 |
| commit | 1e7ae8301d014d49072b7140323866a3ff9f52bd (patch) | |
| tree | 7227bcd628ed1c2ea4184135234c1da03dbf21a6 /MediaBrowser.Api/ApiEntryPoint.cs | |
| parent | 3509a401c8e3d91854b4fda4e4d7700b0aacefa5 (diff) | |
switch to new CC url
Diffstat (limited to 'MediaBrowser.Api/ApiEntryPoint.cs')
| -rw-r--r-- | MediaBrowser.Api/ApiEntryPoint.cs | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index b0b7f8daf..7c67f0a73 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -270,11 +270,7 @@ namespace MediaBrowser.Api job.ActiveRequestCount++; - if (job.KillTimer != null) - { - job.KillTimer.Dispose(); - job.KillTimer = null; - } + job.DisposeKillTimer(); return job; } @@ -286,16 +282,18 @@ namespace MediaBrowser.Api if (job.ActiveRequestCount == 0) { - // The HLS kill timer is long - 1/2 hr. clients should use the manual kill command when stopping. - var timerDuration = job.Type == TranscodingJobType.Progressive ? 1000 : 1800000; - - if (job.KillTimer == null) + if (job.Type == TranscodingJobType.Progressive) { - job.KillTimer = new Timer(OnTranscodeKillTimerStopped, job, timerDuration, Timeout.Infinite); - } - else - { - job.KillTimer.Change(timerDuration, Timeout.Infinite); + const int timerDuration = 1000; + + if (job.KillTimer == null) + { + job.KillTimer = new Timer(OnTranscodeKillTimerStopped, job, timerDuration, Timeout.Infinite); + } + else + { + job.KillTimer.Change(timerDuration, Timeout.Infinite); + } } } } @@ -389,11 +387,7 @@ namespace MediaBrowser.Api job.CancellationTokenSource.Cancel(); } - if (job.KillTimer != null) - { - job.KillTimer.Dispose(); - job.KillTimer = null; - } + job.DisposeKillTimer(); } lock (job.ProcessLock) @@ -580,6 +574,15 @@ namespace MediaBrowser.Api public long? TranscodingPositionTicks { get; set; } public long? DownloadPositionTicks { get; set; } + + public void DisposeKillTimer() + { + if (KillTimer != null) + { + KillTimer.Dispose(); + KillTimer = null; + } + } } /// <summary> |
