diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 03:16:45 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-12-28 03:16:45 -0500 |
| commit | db9eb64e9fe9453172052be0d2923cdb83bdca6a (patch) | |
| tree | eca8b15d4c012b44ef689ec793c364f1d3224b2a /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | 28bbe32d1dc50ce7ad199f50acb5b2b4791b1b4c (diff) | |
increase chances of stream copy
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 42ca927a1..7f568183e 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1967,10 +1967,15 @@ namespace MediaBrowser.Api.Playback state.OutputVideoCodec = state.VideoRequest.VideoCodec; state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream, state.OutputVideoCodec); - if (state.OutputVideoBitrate.HasValue) + if (videoRequest != null) + { + TryStreamCopy(state, videoRequest); + } + + if (state.OutputVideoBitrate.HasValue && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)) { var resolution = ResolutionNormalizer.Normalize( - state.VideoStream == null ? (int?)null : state.VideoStream.BitRate, + state.VideoStream == null ? (int?) null : state.VideoStream.BitRate, state.OutputVideoBitrate.Value, state.VideoStream == null ? null : state.VideoStream.Codec, state.OutputVideoCodec, @@ -1980,13 +1985,12 @@ namespace MediaBrowser.Api.Playback videoRequest.MaxWidth = resolution.MaxWidth; videoRequest.MaxHeight = resolution.MaxHeight; } - } - ApplyDeviceProfileSettings(state); - - if (videoRequest != null) + ApplyDeviceProfileSettings(state); + } + else { - TryStreamCopy(state, videoRequest); + ApplyDeviceProfileSettings(state); } state.OutputFilePath = GetOutputFilePath(state); |
