diff options
Diffstat (limited to 'MediaBrowser.Api')
| -rw-r--r-- | MediaBrowser.Api/ApiEntryPoint.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 9 | ||||
| -rw-r--r-- | MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs | 13 |
3 files changed, 13 insertions, 15 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs index dff60d483..05ff503e4 100644 --- a/MediaBrowser.Api/ApiEntryPoint.cs +++ b/MediaBrowser.Api/ApiEntryPoint.cs @@ -349,12 +349,6 @@ namespace MediaBrowser.Api if (!string.IsNullOrWhiteSpace(job.PlaySessionId)) { timerDuration = 60000; - - // With newer just in time encoding, we no longer need to be aggressive about killing the stream - if (!job.IsLiveOutput) - { - timerDuration = 180000; - } } } diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 1b7bcab53..31679aad3 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1060,7 +1060,7 @@ namespace MediaBrowser.Api.Playback private void StartThrottler(StreamState state, TranscodingJob transcodingJob) { - if (EnableThrottling && state.InputProtocol == MediaProtocol.File && + if (EnableThrottling(state) && state.InputProtocol == MediaProtocol.File && state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) @@ -1073,12 +1073,9 @@ namespace MediaBrowser.Api.Playback } } - protected virtual bool EnableThrottling + protected virtual bool EnableThrottling(StreamState state) { - get - { - return false; - } + return true; } private async void StartStreamingLog(TranscodingJob transcodingJob, StreamState state, Stream source, Stream target) diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs index 72d903a0a..d2b276ba5 100644 --- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs @@ -889,7 +889,7 @@ namespace MediaBrowser.Api.Playback.Hls var startNumberParam = isEncoding ? GetStartNumber(state).ToString(UsCulture) : "0"; var toTimeParam = string.Empty; - if (state.RunTimeTicks.HasValue && state.IsOutputVideo && ApiEntryPoint.Instance.GetEncodingOptions().EnableThrottling) + if (EnableSplitTranscoding(state)) { var startTime = state.Request.StartTimeTicks ?? 0; var durationSeconds = ApiEntryPoint.Instance.GetEncodingOptions().ThrottleThresholdInSeconds; @@ -945,12 +945,19 @@ namespace MediaBrowser.Api.Playback.Hls ).Trim(); } - protected override bool EnableThrottling + protected override bool EnableThrottling(StreamState state) { - get + return !EnableSplitTranscoding(state); + } + + private bool EnableSplitTranscoding(StreamState state) + { + if (string.Equals(Request.QueryString["EnableSplitTranscoding"], "false", StringComparison.OrdinalIgnoreCase)) { return false; } + + return state.RunTimeTicks.HasValue && state.IsOutputVideo; } protected override bool EnableStreamCopy |
