The Free Software Media System - Server Backend & API
increase chances of stream copy
Luke Pulverentidb9eb64e9fe9
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex 42ca927a14..7f568183e3 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -1967,10 +1967,15 @@ namespace MediaBrowser.Api.Playbackstate.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.PlaybackvideoRequest.MaxWidth = resolution.MaxWidth;videoRequest.MaxHeight = resolution.MaxHeight;}- }- ApplyDeviceProfileSettings(state);-- if (videoRequest != null)+ ApplyDeviceProfileSettings(state);+ }+ else{- TryStreamCopy(state, videoRequest);+ ApplyDeviceProfileSettings(state);}state.OutputFilePath = GetOutputFilePath(state);