From 3448a2044b808b9d57887ff4e9679be971e358a5 Mon Sep 17 00:00:00 2001 From: Vlad Jerca Date: Mon, 20 May 2019 10:59:48 +0300 Subject: [PATCH] FFMpegOptions: build paths using the `Combine` util #12 --- FFMpegCore/FFMPEG/FFMpegOptions.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/FFMpegCore/FFMPEG/FFMpegOptions.cs b/FFMpegCore/FFMPEG/FFMpegOptions.cs index a16ba60..f59e632 100644 --- a/FFMpegCore/FFMPEG/FFMpegOptions.cs +++ b/FFMpegCore/FFMPEG/FFMpegOptions.cs @@ -8,8 +8,8 @@ namespace FFMpegCore.FFMPEG { public class FFMpegOptions { - private static string _ConfigFile = $".{Path.DirectorySeparatorChar}ffmpeg.config.json"; - private static string _DefaultRoot = $".{Path.DirectorySeparatorChar}FFMPEG{Path.DirectorySeparatorChar}bin"; + private static string _ConfigFile = Path.Combine(".", "ffmpeg.config.json"); + private static string _DefaultRoot = Path.Combine(".", "FFMPEG", "bin"); public static FFMpegOptions Options { get; private set; } = new FFMpegOptions(); @@ -35,12 +35,12 @@ public string FFmpegBinary var target = Environment.Is64BitProcess ? "x64" : "x86"; var progName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "ffmpeg.exe" : "ffmpeg"; - if (Directory.Exists($"{Options.RootDirectory}{target}")) + if (Directory.Exists(Path.Combine(Options.RootDirectory, target))) { - progName = $"{target}{Path.DirectorySeparatorChar}{progName}"; + progName = Path.Combine(target, progName); } - var path = $"{Options.RootDirectory}{Path.DirectorySeparatorChar}{progName}"; + var path = Path.Combine(Options.RootDirectory, progName); if (!File.Exists(path)) throw new FFMpegException(FFMpegExceptionType.Dependency, @@ -57,12 +57,12 @@ public string FFProbeBinary var target = Environment.Is64BitProcess ? "x64" : "x86"; var progName = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "ffprobe.exe" : "ffprobe"; - if (Directory.Exists($"{Options.RootDirectory}{target}")) + if (Directory.Exists(Path.Combine(Options.RootDirectory, target))) { - progName = $"{target}{Path.DirectorySeparatorChar}{progName}"; + progName = Path.Combine(target, progName); } - var path = $"{Options.RootDirectory}{Path.DirectorySeparatorChar}{progName}"; + var path = Path.Combine(Options.RootDirectory, progName); if (!File.Exists(path)) throw new FFMpegException(FFMpegExceptionType.Dependency,