Skip to content

Commit 7f87cc2

Browse files
committed
Honour $BIZHAWK_DATA_HOME when downloading FFmpeg
also stop looking for `/ffmpeg.exe` in DiscoHawk when it's always downloaded to `/dll/ffmpeg.exe`
1 parent b8d5dd8 commit 7f87cc2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/BizHawk.Client.DiscoHawk/Program.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66

77
using BizHawk.Common;
8+
using BizHawk.Common.PathExtensions;
89
using BizHawk.Emulation.DiscSystem;
910

1011
using OSTC = EXE_PROJECT.OSTailoredCode;
@@ -73,10 +74,7 @@ private static void SubMain(string[] args)
7374
OSTC.LinkedLibManager.FreeByPtr(lib);
7475
}
7576

76-
var ffmpegPath = Path.Combine(GetExeDirectoryAbsolute(), "ffmpeg.exe");
77-
if (!File.Exists(ffmpegPath))
78-
ffmpegPath = Path.Combine(Path.Combine(GetExeDirectoryAbsolute(), "dll"), "ffmpeg.exe");
79-
FFmpegService.FFmpegPath = ffmpegPath;
77+
FFmpegService.FFmpegPath = Path.Combine(PathUtils.DataDirectoryPath, "dll", OSTC.IsUnixHost ? "ffmpeg" : "ffmpeg.exe");
8078

8179
if (args.Length == 0)
8280
{

src/BizHawk.Client.EmuHawk/AVOut/FFmpegDownloaderForm.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ private void Download()
8989
if (exiting)
9090
return;
9191

92+
DirectoryInfo parentDir = new(Path.GetDirectoryName(FFmpegService.FFmpegPath)!);
93+
if (!parentDir.Exists) parentDir.Create();
9294
File.WriteAllBytes(FFmpegService.FFmpegPath, data);
9395
if (OSTailoredCode.IsUnixHost)
9496
{

src/BizHawk.Client.EmuHawk/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static int SubMain(string[] args)
155155
initialConfig.ResolveDefaults();
156156
// initialConfig should really be globalConfig as it's mutable
157157

158-
FFmpegService.FFmpegPath = Path.Combine(PathUtils.DllDirectoryPath, OSTC.IsUnixHost ? "ffmpeg" : "ffmpeg.exe");
158+
FFmpegService.FFmpegPath = Path.Combine(PathUtils.DataDirectoryPath, "dll", OSTC.IsUnixHost ? "ffmpeg" : "ffmpeg.exe");
159159

160160
StringLogUtil.DefaultToDisk = initialConfig.Movies.MoviesOnDisk;
161161

0 commit comments

Comments
 (0)