aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/ApiEntryPoint.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-25 14:29:21 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-25 14:29:21 -0400
commitad52df6be09837086036e46e89c02084de0b7ba2 (patch)
tree4dd88851c568a1f68d1c8bca1bbfeef7e22a84e9 /MediaBrowser.Api/ApiEntryPoint.cs
parentd157c1278b5f59fdf6cd93fc1999c10dc18a9c61 (diff)
re-org scripts
Diffstat (limited to 'MediaBrowser.Api/ApiEntryPoint.cs')
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs35
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