diff --git a/GlobalAssemblyInfo.cs b/GlobalAssemblyInfo.cs index d0f5d10ff..962a3e98b 100644 --- a/GlobalAssemblyInfo.cs +++ b/GlobalAssemblyInfo.cs @@ -30,5 +30,5 @@ [assembly: AssemblyProduct("ShareX")] [assembly: AssemblyCopyright("Copyright (c) 2007-2024 ShareX Team")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("15.0.1")] -[assembly: AssemblyFileVersion("15.0.1")] \ No newline at end of file +[assembly: AssemblyVersion("15.0.2")] +[assembly: AssemblyFileVersion("15.0.2")] \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/ScreenRecording/FFmpegOptions.cs b/ShareX.ScreenCaptureLib/ScreenRecording/FFmpegOptions.cs index 8756f9bc8..e8c677cc6 100644 --- a/ShareX.ScreenCaptureLib/ScreenRecording/FFmpegOptions.cs +++ b/ShareX.ScreenCaptureLib/ScreenRecording/FFmpegOptions.cs @@ -24,6 +24,7 @@ #endregion License Information (GPL v3) using ShareX.HelpersLib; +using System; namespace ShareX.ScreenCaptureLib { @@ -136,5 +137,23 @@ public string Extension public bool IsAnimatedImage => VideoCodec == FFmpegVideoCodec.gif || VideoCodec == FFmpegVideoCodec.libwebp || VideoCodec == FFmpegVideoCodec.apng; public bool IsEvenSizeRequired => !IsAnimatedImage; + + // TEMP: For backward compatibility + public void FixSources() + { + if (VideoSource.Equals("None", StringComparison.OrdinalIgnoreCase)) + { + VideoSource = FFmpegCaptureDevice.None.Value; + } + else if (VideoSource.Equals("GDI grab", StringComparison.OrdinalIgnoreCase)) + { + VideoSource = FFmpegCaptureDevice.GDIGrab.Value; + } + + if (AudioSource.Equals("None", StringComparison.OrdinalIgnoreCase)) + { + AudioSource = FFmpegCaptureDevice.None.Value; + } + } } } \ No newline at end of file diff --git a/ShareX/SettingManager.cs b/ShareX/SettingManager.cs index 9984f8a57..375e49ac1 100644 --- a/ShareX/SettingManager.cs +++ b/ShareX/SettingManager.cs @@ -179,6 +179,7 @@ public static void LoadHotkeysConfig(bool fallbackSupport = true) HotkeysConfig = HotkeysConfig.Load(HotkeysConfigFilePath, BackupFolder, fallbackSupport); HotkeysConfig.CreateBackup = true; HotkeysConfig.CreateWeeklyBackup = true; + HotkeysConfigBackwardCompatibilityTasks(); } public static void LoadAllSettings() @@ -229,9 +230,10 @@ private static void ApplicationConfigBackwardCompatibilityTasks() } } - if (Settings.IsUpgradeFrom("15.0.0")) + if (Settings.IsUpgradeFrom("15.0.1")) { DefaultTaskSettings.CaptureSettings.ScrollingCaptureOptions = new ScrollingCaptureOptions(); + DefaultTaskSettings.CaptureSettings.FFmpegOptions.FixSources(); } } @@ -268,6 +270,21 @@ private static void UploadersConfigBackwardCompatibilityTasks() } } + private static void HotkeysConfigBackwardCompatibilityTasks() + { + if (Settings.IsUpgradeFrom("15.0.1")) + { + foreach (TaskSettings taskSettings in HotkeysConfig.Hotkeys.Select(x => x.TaskSettings)) + { + if (taskSettings != null && taskSettings.CaptureSettings != null) + { + taskSettings.CaptureSettings.ScrollingCaptureOptions = new ScrollingCaptureOptions(); + taskSettings.CaptureSettings.FFmpegOptions.FixSources(); + } + } + } + } + public static void CleanupHotkeysConfig() { foreach (TaskSettings taskSettings in HotkeysConfig.Hotkeys.Select(x => x.TaskSettings))