Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rosenbjerg authored Oct 5, 2023
2 parents ed30b14 + d30629f commit 21c02ba
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions FFMpegCore/GlobalFFOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ private static string GetFFBinaryPath(string name, FFOptions ffOptions)
}

var target = Environment.Is64BitProcess ? "x64" : "x86";
if (Directory.Exists(Path.Combine(ffOptions.BinaryFolder, target)))
var possiblePaths = new List<string>()
{
ffName = Path.Combine(target, ffName);
Path.Combine(ffOptions.BinaryFolder, target),
ffOptions.BinaryFolder
};

foreach (var possiblePath in possiblePaths)
{
var possibleFFMpegPath = Path.Combine(possiblePath, ffName);
if (File.Exists(possibleFFMpegPath))
{
return possibleFFMpegPath;
}
}

return Path.Combine(ffOptions.BinaryFolder, ffName);
//Fall back to the assumption this tool exists in the PATH
return ffName;
}

private static FFOptions LoadFFOptions()
Expand Down

0 comments on commit 21c02ba

Please sign in to comment.