diff options
| author | Bond_009 <Bond.009@outlook.com> | 2019-03-26 22:56:05 +0100 |
|---|---|---|
| committer | Bond_009 <Bond.009@outlook.com> | 2019-03-26 23:00:14 +0100 |
| commit | 93e535d3a143d092effb37e529e5682c3d11802a (patch) | |
| tree | d46bc3203e436f55495408cc1e783836055224d9 /MediaBrowser.Api/ApiEntryPoint.cs | |
| parent | 31607fbb377c826415dc0f6689ac4189b38c840f (diff) | |
Trying to make sense of the streaming code
Mostly small changes as I was looking through the code.
* async void -> async Task
* Properly implemented dispose methods
* Pass the logstream directly to the JobLogger
* Style fixes
Diffstat (limited to 'MediaBrowser.Api/ApiEntryPoint.cs')
| -rw-r--r-- | MediaBrowser.Api/ApiEntryPoint.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index 700cbb943..a223a4fe3 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -415,7 +415,7 @@ namespace MediaBrowser.Api public void OnTranscodeEndRequest(TranscodingJob job) { job.ActiveRequestCount--; - //Logger.LogDebug("OnTranscodeEndRequest job.ActiveRequestCount={0}", job.ActiveRequestCount); + Logger.LogDebug("OnTranscodeEndRequest job.ActiveRequestCount={0}", job.ActiveRequestCount); if (job.ActiveRequestCount <= 0) { PingTimer(job, false); @@ -428,7 +428,7 @@ namespace MediaBrowser.Api throw new ArgumentNullException(nameof(playSessionId)); } - //Logger.LogDebug("PingTranscodingJob PlaySessionId={0} isUsedPaused: {1}", playSessionId, isUserPaused); + Logger.LogDebug("PingTranscodingJob PlaySessionId={0} isUsedPaused: {1}", playSessionId, isUserPaused); List<TranscodingJob> jobs; @@ -443,7 +443,7 @@ namespace MediaBrowser.Api { if (isUserPaused.HasValue) { - //Logger.LogDebug("Setting job.IsUserPaused to {0}. jobId: {1}", isUserPaused, job.Id); + Logger.LogDebug("Setting job.IsUserPaused to {0}. jobId: {1}", isUserPaused, job.Id); job.IsUserPaused = isUserPaused.Value; } PingTimer(job, true); @@ -601,7 +601,6 @@ namespace MediaBrowser.Api { Logger.LogInformation("Stopping ffmpeg process with q command for {Path}", job.Path); - //process.Kill(); process.StandardInput.WriteLine("q"); // Need to wait because killing is asynchronous @@ -701,7 +700,7 @@ namespace MediaBrowser.Api { try { - //Logger.LogDebug("Deleting HLS file {0}", file); + Logger.LogDebug("Deleting HLS file {0}", file); _fileSystem.DeleteFile(file); } catch (FileNotFoundException) @@ -840,12 +839,12 @@ namespace MediaBrowser.Api { if (KillTimer == null) { - //Logger.LogDebug("Starting kill timer at {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); + Logger.LogDebug("Starting kill timer at {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer = new Timer(new TimerCallback(callback), this, intervalMs, Timeout.Infinite); } else { - //Logger.LogDebug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); + Logger.LogDebug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } @@ -864,7 +863,7 @@ namespace MediaBrowser.Api { var intervalMs = PingTimeout; - //Logger.LogDebug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); + Logger.LogDebug("Changing kill timer to {0}ms. JobId {1} PlaySessionId {2}", intervalMs, Id, PlaySessionId); KillTimer.Change(intervalMs, Timeout.Infinite); } } |
