Apply suggestions from code review

Co-authored-by: Cody Robibero <cody@robibe.ro>
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
Co-authored-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
nyanmisaka
2021-12-24 16:50:40 +08:00
parent 4b9c84c52e
commit b2d85a02c2
7 changed files with 572 additions and 588 deletions

View File

@@ -351,18 +351,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false;
}
string output;
try
{
output = GetProcessOutput(_encoderPath, "-v verbose -hide_banner -init_hw_device vaapi=va:" + renderNodePath, true);
var output = GetProcessOutput(_encoderPath, "-v verbose -hide_banner -init_hw_device vaapi=va:" + renderNodePath, true);
return output.Contains(driverName, StringComparison.Ordinal);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error detecting the given vaapi render node path");
return false;
}
return output.Contains(driverName, StringComparison.Ordinal);
}
private IEnumerable<string> GetHwaccelTypes()