diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:01:13 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:01:13 +0100 |
| commit | 52194f56b5f07e3ae01e2fb6d121452e37d1e93f (patch) | |
| tree | fd638972f72ec49734ad07f831a3aae3b2501a1d /Jellyfin.Api/Helpers/StreamingHelpers.cs | |
| parent | c7d50d640e614a3c13699e3041fbfcb258861c5a (diff) | |
Replace != null with is not null
Diffstat (limited to 'Jellyfin.Api/Helpers/StreamingHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/StreamingHelpers.cs | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index 5e01b7dcc..1decbcd92 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -137,7 +137,7 @@ namespace Jellyfin.Api.Helpers ? transcodingJobHelper.GetTranscodingJob(streamingRequest.PlaySessionId) : null; - if (currentJob != null) + if (currentJob is not null) { mediaSource = currentJob.MediaSource; } @@ -189,7 +189,7 @@ namespace Jellyfin.Api.Helpers state.OutputAudioChannels = encodingHelper.GetNumAudioChannelsParam(state, state.AudioStream, state.OutputAudioCodec); - if (state.VideoRequest != null) + if (state.VideoRequest is not null) { state.OutputVideoCodec = state.Request.VideoCodec; state.OutputVideoBitrate = encodingHelper.GetVideoBitrateParamValue(state.VideoRequest, state.VideoStream, state.OutputVideoCodec); @@ -204,7 +204,7 @@ namespace Jellyfin.Api.Helpers && !state.VideoRequest.MaxHeight.HasValue; if (isVideoResolutionNotRequested - && state.VideoStream != null + && state.VideoStream is not null && state.VideoRequest.VideoBitRate.HasValue && state.VideoStream.BitRate.HasValue && state.VideoRequest.VideoBitRate.Value >= state.VideoStream.BitRate.Value) @@ -281,7 +281,7 @@ namespace Jellyfin.Api.Helpers Convert.ToInt32(ms))); } - if (!isStaticallyStreamed && profile != null) + if (!isStaticallyStreamed && profile is not null) { AddTimeSeekResponseHeaders(state, responseHeaders, startTimeTicks); } @@ -553,7 +553,7 @@ namespace Jellyfin.Api.Helpers state.TargetVideoCodecTag, state.IsTargetAVC); - if (mediaProfile != null) + if (mediaProfile is not null) { state.MimeType = mediaProfile.MimeType; } @@ -562,13 +562,13 @@ namespace Jellyfin.Api.Helpers { var transcodingProfile = !state.IsVideoRequest ? profile.GetAudioTranscodingProfile(state.OutputContainer, audioCodec) : profile.GetVideoTranscodingProfile(state.OutputContainer, audioCodec, videoCodec); - if (transcodingProfile != null) + if (transcodingProfile is not null) { state.EstimateContentLength = transcodingProfile.EstimateContentLength; // state.EnableMpegtsM2TsMode = transcodingProfile.EnableMpegtsM2TsMode; state.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo; - if (state.VideoRequest != null) + if (state.VideoRequest is not null) { state.VideoRequest.CopyTimestamps = transcodingProfile.CopyTimestamps; state.VideoRequest.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest; @@ -616,7 +616,7 @@ namespace Jellyfin.Api.Helpers request.Static = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); break; case 4: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.VideoCodec = val; } @@ -626,21 +626,21 @@ namespace Jellyfin.Api.Helpers request.AudioCodec = val; break; case 6: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.AudioStreamIndex = int.Parse(val, CultureInfo.InvariantCulture); } break; case 7: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.SubtitleStreamIndex = int.Parse(val, CultureInfo.InvariantCulture); } break; case 8: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.VideoBitRate = int.Parse(val, CultureInfo.InvariantCulture); } @@ -653,21 +653,21 @@ namespace Jellyfin.Api.Helpers request.MaxAudioChannels = int.Parse(val, CultureInfo.InvariantCulture); break; case 11: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.MaxFramerate = float.Parse(val, CultureInfo.InvariantCulture); } break; case 12: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.MaxWidth = int.Parse(val, CultureInfo.InvariantCulture); } break; case 13: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.MaxHeight = int.Parse(val, CultureInfo.InvariantCulture); } @@ -677,28 +677,28 @@ namespace Jellyfin.Api.Helpers request.StartTimeTicks = long.Parse(val, CultureInfo.InvariantCulture); break; case 15: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.Level = val; } break; case 16: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.MaxRefFrames = int.Parse(val, CultureInfo.InvariantCulture); } break; case 17: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.MaxVideoBitDepth = int.Parse(val, CultureInfo.InvariantCulture); } break; case 18: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.Profile = val; } @@ -720,14 +720,14 @@ namespace Jellyfin.Api.Helpers // Duplicating ItemId because of MediaMonkey break; case 24: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.CopyTimestamps = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } break; case 25: - if (!string.IsNullOrWhiteSpace(val) && videoRequest != null) + if (!string.IsNullOrWhiteSpace(val) && videoRequest is not null) { if (Enum.TryParse(val, out SubtitleDeliveryMethod method)) { @@ -740,7 +740,7 @@ namespace Jellyfin.Api.Helpers request.TranscodingMaxAudioChannels = int.Parse(val, CultureInfo.InvariantCulture); break; case 27: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } @@ -750,7 +750,7 @@ namespace Jellyfin.Api.Helpers request.Tag = val; break; case 29: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.RequireAvc = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } @@ -760,14 +760,14 @@ namespace Jellyfin.Api.Helpers request.SubtitleCodec = val; break; case 31: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.RequireNonAnamorphic = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } break; case 32: - if (videoRequest != null) + if (videoRequest is not null) { videoRequest.DeInterlace = string.Equals("true", val, StringComparison.OrdinalIgnoreCase); } |
