mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-02-02 00:18:30 +00:00
Remove warninigs from MediaBrowser.Controller (Part 3) (#6078)
Co-authored-by: Bond-009 <bond.009@outlook.com>
This commit is contained in:
@@ -1166,7 +1166,9 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
profileScore = Math.Min(profileScore, 2);
|
||||
|
||||
// http://www.webmproject.org/docs/encoder-parameters/
|
||||
param += string.Format(CultureInfo.InvariantCulture, " -speed 16 -quality good -profile:v {0} -slices 8 -crf {1} -qmin {2} -qmax {3}",
|
||||
param += string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
" -speed 16 -quality good -profile:v {0} -slices 8 -crf {1} -qmin {2} -qmax {3}",
|
||||
profileScore.ToString(_usCulture),
|
||||
crf,
|
||||
qmin,
|
||||
@@ -1296,7 +1298,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
// hevc_qsv use -level 51 instead of -level 153.
|
||||
if (double.TryParse(level, NumberStyles.Any, _usCulture, out double hevcLevel))
|
||||
{
|
||||
param += " -level " + hevcLevel / 3;
|
||||
param += " -level " + (hevcLevel / 3);
|
||||
}
|
||||
}
|
||||
else if (string.Equals(videoEncoder, "h264_amf", StringComparison.OrdinalIgnoreCase)
|
||||
@@ -1392,7 +1394,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var requestedProfile = requestedProfiles[0];
|
||||
// strip spaces because they may be stripped out on the query string as well
|
||||
if (!string.IsNullOrEmpty(videoStream.Profile)
|
||||
&& !requestedProfiles.Contains(videoStream.Profile.Replace(" ", "", StringComparison.Ordinal), StringComparer.OrdinalIgnoreCase))
|
||||
&& !requestedProfiles.Contains(videoStream.Profile.Replace(" ", string.Empty, StringComparison.Ordinal), StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
var currentScore = GetVideoProfileScore(videoStream.Profile);
|
||||
var requestedScore = GetVideoProfileScore(requestedProfile);
|
||||
@@ -1801,7 +1803,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
if (isTranscodingAudio
|
||||
&& state.TranscodingType != TranscodingJobType.Progressive
|
||||
&& resultChannels.HasValue
|
||||
&& (resultChannels.Value > 2 && resultChannels.Value < 6 || resultChannels.Value == 7))
|
||||
&& ((resultChannels.Value > 2 && resultChannels.Value < 6) || resultChannels.Value == 7))
|
||||
{
|
||||
resultChannels = 2;
|
||||
}
|
||||
@@ -2129,8 +2131,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return (null, null);
|
||||
}
|
||||
|
||||
decimal inputWidth = Convert.ToDecimal(videoWidth ?? requestedWidth);
|
||||
decimal inputHeight = Convert.ToDecimal(videoHeight ?? requestedHeight);
|
||||
decimal inputWidth = Convert.ToDecimal(videoWidth ?? requestedWidth, CultureInfo.InvariantCulture);
|
||||
decimal inputHeight = Convert.ToDecimal(videoHeight ?? requestedHeight, CultureInfo.InvariantCulture);
|
||||
decimal outputWidth = requestedWidth.HasValue ? Convert.ToDecimal(requestedWidth.Value) : inputWidth;
|
||||
decimal outputHeight = requestedHeight.HasValue ? Convert.ToDecimal(requestedHeight.Value) : inputHeight;
|
||||
decimal maximumWidth = requestedMaxWidth.HasValue ? Convert.ToDecimal(requestedMaxWidth.Value) : outputWidth;
|
||||
@@ -2197,12 +2199,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var isQsvHevcEncoder = videoEncoder.Contains("hevc_qsv", StringComparison.OrdinalIgnoreCase);
|
||||
var isTonemappingSupported = IsTonemappingSupported(state, options);
|
||||
var isVppTonemappingSupported = IsVppTonemappingSupported(state, options);
|
||||
var isTonemappingSupportedOnVaapi = string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)&& isVaapiDecoder && (isVaapiH264Encoder || isVaapiHevcEncoder);
|
||||
var isTonemappingSupportedOnVaapi = string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase) && isVaapiDecoder && (isVaapiH264Encoder || isVaapiHevcEncoder);
|
||||
var isTonemappingSupportedOnQsv = string.Equals(options.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase) && isVaapiDecoder && (isQsvH264Encoder || isQsvHevcEncoder);
|
||||
var isP010PixFmtRequired = (isTonemappingSupportedOnVaapi && (isTonemappingSupported || isVppTonemappingSupported))
|
||||
|| (isTonemappingSupportedOnQsv && isVppTonemappingSupported);
|
||||
|
||||
|
||||
var outputPixFmt = "format=nv12";
|
||||
if (isP010PixFmtRequired)
|
||||
{
|
||||
@@ -3175,8 +3176,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
state.ReadInputAtNativeFramerate = mediaSource.ReadAtNativeFramerate;
|
||||
|
||||
if (state.ReadInputAtNativeFramerate
|
||||
|| mediaSource.Protocol == MediaProtocol.File
|
||||
&& string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase))
|
||||
|| (mediaSource.Protocol == MediaProtocol.File
|
||||
&& string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
state.InputVideoSync = "-1";
|
||||
state.InputAudioSync = "1";
|
||||
@@ -3549,7 +3550,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a hw decoder name
|
||||
/// Gets a hw decoder name.
|
||||
/// </summary>
|
||||
public string GetHwDecoderName(EncodingOptions options, string decoder, string videoCodec, bool isColorDepth10)
|
||||
{
|
||||
@@ -3567,7 +3568,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a hwaccel type to use as a hardware decoder(dxva/vaapi) depending on the system
|
||||
/// Gets a hwaccel type to use as a hardware decoder(dxva/vaapi) depending on the system.
|
||||
/// </summary>
|
||||
public string GetHwaccelType(EncodingJobInfo state, EncodingOptions options, string videoCodec, bool isColorDepth10)
|
||||
{
|
||||
@@ -3693,7 +3694,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
if (flags.Count > 0)
|
||||
{
|
||||
return " -fflags " + string.Join("", flags);
|
||||
return " -fflags " + string.Join(string.Empty, flags);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user