Apply suggestions from code review

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
Nyanmisaka 2020-11-24 16:27:46 +00:00 committed by GitHub
parent 75963d9181
commit 44dc1c3729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,8 +115,11 @@ namespace MediaBrowser.Controller.MediaEncoding
private bool IsTonemappingSupported(EncodingJobInfo state, EncodingOptions options)
{
var videoStream = state.VideoStream;
var isColorDepth10 = IsColorDepth10(state);
return isColorDepth10 && _mediaEncoder.SupportsHwaccel("opencl") && options.EnableTonemapping && !string.IsNullOrEmpty(videoStream.VideoRange) && videoStream.VideoRange.Contains("HDR", StringComparison.OrdinalIgnoreCase);
return IsColorDepth10(state)
&& _mediaEncoder.SupportsHwaccel("opencl")
&& options.EnableTonemapping
&& !string.IsNullOrEmpty(videoStream.VideoRange)
&& videoStream.VideoRange.Contains("HDR", StringComparison.OrdinalIgnoreCase);
}
/// <summary>