aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs11
-rw-r--r--MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs68
2 files changed, 44 insertions, 35 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index 1a7f4a2b1..bb9d2b864 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -63,6 +63,15 @@ namespace MediaBrowser.Api
Instance = this;
_sessionManager.PlaybackProgress += _sessionManager_PlaybackProgress;
+ _sessionManager.PlaybackStart += _sessionManager_PlaybackStart;
+ }
+
+ private void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
+ {
+ if (!string.IsNullOrWhiteSpace(e.PlaySessionId))
+ {
+ PingTranscodingJob(e.PlaySessionId, e.IsPaused);
+ }
}
void _sessionManager_PlaybackProgress(object sender, PlaybackProgressEventArgs e)
@@ -401,7 +410,7 @@ namespace MediaBrowser.Api
}
}
- Logger.Debug("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId);
+ Logger.Info("Transcoding kill timer stopped for JobId {0} PlaySessionId {1}. Killing transcoding", job.Id, job.PlaySessionId);
KillTranscodingJob(job, true, path => true);
}
diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
index 4649499c4..d6dea0fe5 100644
--- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
+++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs
@@ -165,40 +165,40 @@ namespace MediaBrowser.Api.Playback.Progressive
}
}
- // Not static but transcode cache file exists
- if (isTranscodeCached)
- {
- var contentType = state.GetMimeType(outputPath);
-
- try
- {
- if (transcodingJob != null)
- {
- ApiEntryPoint.Instance.OnTranscodeBeginRequest(transcodingJob);
- }
-
- return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
- {
- ResponseHeaders = responseHeaders,
- ContentType = contentType,
- IsHeadRequest = isHeadRequest,
- Path = outputPath,
- FileShare = FileShare.ReadWrite,
- OnComplete = () =>
- {
- if (transcodingJob != null)
- {
- ApiEntryPoint.Instance.OnTranscodeEndRequest(transcodingJob);
- }
- }
-
- }).ConfigureAwait(false);
- }
- finally
- {
- state.Dispose();
- }
- }
+ //// Not static but transcode cache file exists
+ //if (isTranscodeCached && state.VideoRequest == null)
+ //{
+ // var contentType = state.GetMimeType(outputPath);
+
+ // try
+ // {
+ // if (transcodingJob != null)
+ // {
+ // ApiEntryPoint.Instance.OnTranscodeBeginRequest(transcodingJob);
+ // }
+
+ // return await ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
+ // {
+ // ResponseHeaders = responseHeaders,
+ // ContentType = contentType,
+ // IsHeadRequest = isHeadRequest,
+ // Path = outputPath,
+ // FileShare = FileShare.ReadWrite,
+ // OnComplete = () =>
+ // {
+ // if (transcodingJob != null)
+ // {
+ // ApiEntryPoint.Instance.OnTranscodeEndRequest(transcodingJob);
+ // }
+ // }
+
+ // }).ConfigureAwait(false);
+ // }
+ // finally
+ // {
+ // state.Dispose();
+ // }
+ //}
// Need to start ffmpeg
try