aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-02-13 17:01:09 +0100
committerGitHub <noreply@github.com>2020-02-13 17:01:09 +0100
commit407ba755f1ef257f476024157959e88e58f1d1f9 (patch)
tree78a51f09c0ed94eb2e01a313c91ec1867d4386d5
parent8ee917143f65c3bd62082390bb9a767f1b101014 (diff)
parenta26c1ab17dd0bb4c7cefa9130c19128a08a57aee (diff)
Merge pull request #2258 from geilername/transcoding-throttling
Enable Throttling when transcoding without Hardware-Acceleration
-rw-r--r--CONTRIBUTORS.md2
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs20
2 files changed, 14 insertions, 8 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 800b3d51f..2a9779cd5 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -32,8 +32,10 @@
- [nevado](https://github.com/nevado)
- [mark-monteiro](https://github.com/mark-monteiro)
- [ullmie02](https://github.com/ullmie02)
+ - [geilername](https://github.com/geilername)
- [pR0Ps](https://github.com/pR0Ps)
+
# Emby Contributors
- [LukePulverenti](https://github.com/LukePulverenti)
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>