From 4a403fd65f0635637f5a81c37627ff946bc15e5b Mon Sep 17 00:00:00 2001 From: mcored Date: Wed, 4 Jun 2014 09:03:28 +0800 Subject: [PATCH] Prevent FFmpeg Custom Commands from getting overwritten --- ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs | 10 +++++----- ScreenCaptureLib/Screencast/ScreencastOptions.cs | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs index f2e13f6fc..7e12c50f2 100644 --- a/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs +++ b/ScreenCaptureLib/Screencast/FFmpegOptionsForm.cs @@ -338,15 +338,15 @@ private void cbCustomCommands_CheckedChanged(object sender, EventArgs e) Options.FFmpeg.UseCustomCommands = cbCustomCommands.Checked; txtCommandLinePreview.ReadOnly = !Options.FFmpeg.UseCustomCommands; - if (!Options.FFmpeg.UseCustomCommands) - { - txtCommandLinePreview.Text = Options.GetFFmpegCommands(); - } + txtCommandLinePreview.Text = Options.FFmpeg.UseCustomCommands ? Options.FFmpeg.CustomCommands : Options.GetFFmpegCommands(); } private void txtCommandLinePreview_TextChanged(object sender, EventArgs e) { - Options.FFmpeg.CustomCommands = txtCommandLinePreview.Text; + if (cbCustomCommands.Checked) + { + Options.FFmpeg.CustomCommands = txtCommandLinePreview.Text; + } } } } \ No newline at end of file diff --git a/ScreenCaptureLib/Screencast/ScreencastOptions.cs b/ScreenCaptureLib/Screencast/ScreencastOptions.cs index 3711d085b..73681b7e3 100644 --- a/ScreenCaptureLib/Screencast/ScreencastOptions.cs +++ b/ScreenCaptureLib/Screencast/ScreencastOptions.cs @@ -77,8 +77,10 @@ public string GetFFmpegCommands() return commands; } - - return GetFFmpegArgs(); + else + { + return GetFFmpegArgs(); + } } private string GetFFmpegArgs()