Compare commits

..

No commits in common. "5fa92707e6278bd31b16be388608666dcac4708a" and "1f164472c70205d03fbc380e192463084e07e43a" have entirely different histories.

View file

@ -5,7 +5,7 @@ namespace FFMpegCore.Helpers
{
public static class FFMpegHelper
{
private static string? _ffmpegPathVerified;
private static bool _ffmpegVerified;
public static void ConversionSizeExceptionCheck(IMediaAnalysis info)
=> ConversionSizeExceptionCheck(info.PrimaryVideoStream!.Width, info.PrimaryVideoStream.Height);
@ -37,23 +37,22 @@ namespace FFMpegCore.Helpers
public static void VerifyFFMpegExists(FFOptions ffMpegOptions)
{
var binaryPath = GlobalFFOptions.GetFFMpegBinaryPath(ffMpegOptions);
if (_ffmpegPathVerified != null && _ffmpegPathVerified == binaryPath)
if (_ffmpegVerified)
{
return;
}
try
{
var result = Instance.Finish(binaryPath, "-version");
_ffmpegPathVerified = result.ExitCode == 0 ? binaryPath : null;
var result = Instance.Finish(GlobalFFOptions.GetFFMpegBinaryPath(ffMpegOptions), "-version");
_ffmpegVerified = result.ExitCode == 0;
}
catch (Exception e)
{
throw new FFMpegException(FFMpegExceptionType.Operation, "ffmpeg was not found on your system", e);
}
if (_ffmpegPathVerified == null)
if (!_ffmpegVerified)
{
throw new FFMpegException(FFMpegExceptionType.Operation, "ffmpeg was not found on your system");
}