Browse Source

Apply suggestions from code review

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
Cody Robibero 3 years ago
parent
commit
3f2c706575
1 changed files with 2 additions and 2 deletions
  1. 2 2
      MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

+ 2 - 2
MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs

@@ -3306,7 +3306,7 @@ namespace MediaBrowser.Controller.MediaEncoding
                 inputModifier += " " + videoDecoder;
                 inputModifier += " " + videoDecoder;
 
 
                 if (!IsCopyCodec(state.OutputVideoCodec)
                 if (!IsCopyCodec(state.OutputVideoCodec)
-                    && videoDecoder.IndexOf("cuvid", StringComparison.OrdinalIgnoreCase) != -1)
+                    && videoDecoder.Contains("cuvid", StringComparison.OrdinalIgnoreCase))
                 {
                 {
                     var videoStream = state.VideoStream;
                     var videoStream = state.VideoStream;
                     var inputWidth = videoStream?.Width;
                     var inputWidth = videoStream?.Width;
@@ -3315,7 +3315,7 @@ namespace MediaBrowser.Controller.MediaEncoding
 
 
                     var (width, height) = GetFixedOutputSize(inputWidth, inputHeight, request.Width, request.Height, request.MaxWidth, request.MaxHeight);
                     var (width, height) = GetFixedOutputSize(inputWidth, inputHeight, request.Width, request.Height, request.MaxWidth, request.MaxHeight);
 
 
-                    if (videoDecoder.IndexOf("cuvid", StringComparison.OrdinalIgnoreCase) != -1
+                    if (videoDecoder.Contains("cuvid", StringComparison.OrdinalIgnoreCase)
                         && width.HasValue
                         && width.HasValue
                         && height.HasValue)
                         && height.HasValue)
                     {
                     {