diff options
| author | artiume <siderite@gmail.com> | 2020-02-13 13:09:50 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-13 13:09:50 -0500 |
| commit | 63f13df6fc0c01e09b867d19ca286e754655cfdd (patch) | |
| tree | f70eac01399eb3c84bf2e4d0115d7bd898b83dd6 /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | 40ad6f843fddab81bdaf26af4e6530ce4529eebf (diff) | |
| parent | cf2626428c0d4755662855fe6c3e4f439c909de9 (diff) | |
Merge pull request #17 from jellyfin/master
10.5
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index ab74bab1c..7837aa65b 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -327,15 +327,19 @@ namespace MediaBrowser.Api.Playback private bool EnableThrottling(StreamState state) { + var encodingOptions = ServerConfigurationManager.GetEncodingOptions(); + + // enable throttling when NOT using hardware acceleration + if (encodingOptions.HardwareAccelerationType == string.Empty) + { + return state.InputProtocol == MediaProtocol.File && + state.RunTimeTicks.HasValue && + state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks && + state.IsInputVideo && + state.VideoType == VideoType.VideoFile && + !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase); + } return false; - //// do not use throttling with hardware encoders - //return state.InputProtocol == MediaProtocol.File && - // state.RunTimeTicks.HasValue && - // state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks && - // state.IsInputVideo && - // state.VideoType == VideoType.VideoFile && - // !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase) && - // string.Equals(GetVideoEncoder(state), "libx264", StringComparison.OrdinalIgnoreCase); } /// <summary> |
