mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-24 14:40:39 +02:00
increase chances of stream copy
This commit is contained in:
parent
28bbe32d1d
commit
db9eb64e9f
|
@ -1967,10 +1967,15 @@ namespace MediaBrowser.Api.Playback
|
||||||
state.OutputVideoCodec = state.VideoRequest.VideoCodec;
|
state.OutputVideoCodec = state.VideoRequest.VideoCodec;
|
||||||
state.OutputVideoBitrate = GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream, state.OutputVideoCodec);
|
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(
|
var resolution = ResolutionNormalizer.Normalize(
|
||||||
state.VideoStream == null ? (int?)null : state.VideoStream.BitRate,
|
state.VideoStream == null ? (int?) null : state.VideoStream.BitRate,
|
||||||
state.OutputVideoBitrate.Value,
|
state.OutputVideoBitrate.Value,
|
||||||
state.VideoStream == null ? null : state.VideoStream.Codec,
|
state.VideoStream == null ? null : state.VideoStream.Codec,
|
||||||
state.OutputVideoCodec,
|
state.OutputVideoCodec,
|
||||||
|
@ -1980,13 +1985,12 @@ namespace MediaBrowser.Api.Playback
|
||||||
videoRequest.MaxWidth = resolution.MaxWidth;
|
videoRequest.MaxWidth = resolution.MaxWidth;
|
||||||
videoRequest.MaxHeight = resolution.MaxHeight;
|
videoRequest.MaxHeight = resolution.MaxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApplyDeviceProfileSettings(state);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
ApplyDeviceProfileSettings(state);
|
|
||||||
|
|
||||||
if (videoRequest != null)
|
|
||||||
{
|
{
|
||||||
TryStreamCopy(state, videoRequest);
|
ApplyDeviceProfileSettings(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
state.OutputFilePath = GetOutputFilePath(state);
|
state.OutputFilePath = GetOutputFilePath(state);
|
||||||
|
|
Loading…
Reference in a new issue