Merge pull request #2258 from geilername/transcoding-throttling
Enable Throttling when transcoding without Hardware-Acceleration
This commit is contained in:
commit
407ba755f1
|
@ -32,8 +32,10 @@
|
||||||
- [nevado](https://github.com/nevado)
|
- [nevado](https://github.com/nevado)
|
||||||
- [mark-monteiro](https://github.com/mark-monteiro)
|
- [mark-monteiro](https://github.com/mark-monteiro)
|
||||||
- [ullmie02](https://github.com/ullmie02)
|
- [ullmie02](https://github.com/ullmie02)
|
||||||
|
- [geilername](https://github.com/geilername)
|
||||||
- [pR0Ps](https://github.com/pR0Ps)
|
- [pR0Ps](https://github.com/pR0Ps)
|
||||||
|
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
|
||||||
- [LukePulverenti](https://github.com/LukePulverenti)
|
- [LukePulverenti](https://github.com/LukePulverenti)
|
||||||
|
|
|
@ -327,15 +327,19 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
private bool EnableThrottling(StreamState state)
|
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;
|
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>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user