mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-18 12:36:44 +00:00
Fix issue where ffmpeg can't be found if x64/x86 folders exist without ffmpeg in there
This commit is contained in:
parent
943662aa15
commit
a920ab2bc1
1 changed files with 14 additions and 3 deletions
|
@ -30,12 +30,23 @@ private static string GetFFBinaryPath(string name, FFOptions ffOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
var target = Environment.Is64BitProcess ? "x64" : "x86";
|
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()
|
private static FFOptions LoadFFOptions()
|
||||||
|
|
Loading…
Reference in a new issue