aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-08-10 15:16:44 -0400
committerGitHub <noreply@github.com>2016-08-10 15:16:44 -0400
commitb3e9e85c0557e0511a5fae154f657573260d5fe9 (patch)
tree6a02074ac9318a5b4fea8a90f5d3ed48241ee8b1 /MediaBrowser.Api
parent1b4e789df8435c1996b556e3e346f3bb6c198cc3 (diff)
parent00307b9a44e6940a7c8c547cf0ffa6232f805cca (diff)
Merge pull request #2046 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs21
1 files changed, 11 insertions, 10 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index 164d607d28..59dfd87ecd 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -1118,22 +1118,23 @@ namespace MediaBrowser.Api.Playback
private void StartThrottler(StreamState state, TranscodingJob transcodingJob)
{
- if (EnableThrottling(state) && state.InputProtocol == MediaProtocol.File &&
- state.RunTimeTicks.HasValue &&
- state.VideoType == VideoType.VideoFile &&
- !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
+ if (EnableThrottling(state) && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
{
- if (state.RunTimeTicks.Value >= TimeSpan.FromMinutes(5).Ticks && state.IsInputVideo)
- {
- transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager);
- state.TranscodingThrottler.Start();
- }
+ transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, Logger, ServerConfigurationManager);
+ state.TranscodingThrottler.Start();
}
}
protected virtual bool EnableThrottling(StreamState state)
{
- return true;
+ // 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);
}
private async Task StartStreamingLog(TranscodingJob transcodingJob, StreamState state, Stream source, Stream target)