mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-17 19:45:44 +00:00
Compare commits
No commits in common. "5fa92707e6278bd31b16be388608666dcac4708a" and "1f164472c70205d03fbc380e192463084e07e43a" have entirely different histories.
5fa92707e6
...
1f164472c7
1 changed files with 5 additions and 6 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue