diff --git a/Code/AudioVideo/AvProcess.cs b/Code/AudioVideo/AvProcess.cs index cb132f6..28f5d06 100644 --- a/Code/AudioVideo/AvProcess.cs +++ b/Code/AudioVideo/AvProcess.cs @@ -91,6 +91,8 @@ namespace Flowframes public static async Task GetFfmpegOutputAsync(string args, bool setBusy = false) { + if (Program.busy) + setBusy = false; lastOutputFfmpeg = ""; Process ffmpeg = OSUtils.NewProcess(true); lastProcess = ffmpeg; @@ -181,11 +183,9 @@ namespace Flowframes { if (Program.busy) return; - Program.mainForm.SetWorking(true); await Task.Delay(100); while(!lastProcess.HasExited) await Task.Delay(10); - Program.mainForm.SetWorking(false); } } } diff --git a/Code/Form1.cs b/Code/Form1.cs index 47edf39..88165b5 100644 --- a/Code/Form1.cs +++ b/Code/Form1.cs @@ -234,6 +234,7 @@ namespace Flowframes public void SetWorking(bool state, bool allowCancel = true) { + Logger.Log($"SetWorking({state})"); Control[] controlsToDisable = new Control[] { runBtn, runStepBtn, stepSelector, settingsBtn, installerBtn }; Control[] controlsToHide = new Control[] { runBtn, runStepBtn, stepSelector }; progressCircle.Visible = state; @@ -242,8 +243,7 @@ namespace Flowframes c.Enabled = !state; foreach (Control c in controlsToHide) c.Visible = !state; - if (!allowCancel) - cancelBtn.Enabled = false; + cancelBtn.Enabled = allowCancel; Program.busy = state; Program.mainForm.UpdateStepByStepControls(false); } diff --git a/Code/Forms/SettingsForm.Designer.cs b/Code/Forms/SettingsForm.Designer.cs index 2b817a4..cd4b103 100644 --- a/Code/Forms/SettingsForm.Designer.cs +++ b/Code/Forms/SettingsForm.Designer.cs @@ -828,9 +828,9 @@ this.label28.Location = new System.Drawing.Point(10, 150); this.label28.Margin = new System.Windows.Forms.Padding(10, 10, 10, 7); this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(158, 16); + this.label28.Size = new System.Drawing.Size(102, 16); this.label28.TabIndex = 61; - this.label28.Text = "RIFE (CUDA) Settings"; + this.label28.Text = "RIFE Settings"; // // panel12 // diff --git a/Code/IO/IOUtils.cs b/Code/IO/IOUtils.cs index d1939b8..a081706 100644 --- a/Code/IO/IOUtils.cs +++ b/Code/IO/IOUtils.cs @@ -527,6 +527,11 @@ namespace Flowframes.IO { Benchmarker.Start(); string hashStr = ""; + if (IsPathDirectory(path)) + { + Logger.Log($"Path is directory! Returning empty hash for {Path.GetFileName(path)}", true); + return hashStr; + } try { if (hashType == Hash.MD5) @@ -550,6 +555,7 @@ namespace Flowframes.IO catch (Exception e) { Logger.Log($"Error getting file hash for {Path.GetFileName(path)}: {e.Message}", true); + return ""; } if (log) Logger.Log($"Computed {hashType} for '{Path.GetFileNameWithoutExtension(path).Trunc(40) + Path.GetExtension(path)}' ({GetFilesizeStr(path)}) in {Benchmarker.GetTimeStr(true)}: {hashStr}", true); diff --git a/Code/Main/InterpolateSteps.cs b/Code/Main/InterpolateSteps.cs index d414939..0f22fd0 100644 --- a/Code/Main/InterpolateSteps.cs +++ b/Code/Main/InterpolateSteps.cs @@ -25,6 +25,7 @@ namespace Flowframes.Main public static async Task Run(string step) { + Logger.Log($"[SBS] Running step '{step}'", true); canceled = false; Program.mainForm.SetWorking(true); current = Program.mainForm.GetCurrentSettings(); diff --git a/Code/Main/InterpolateUtils.cs b/Code/Main/InterpolateUtils.cs index 3501ca0..f22d9fc 100644 --- a/Code/Main/InterpolateUtils.cs +++ b/Code/Main/InterpolateUtils.cs @@ -38,6 +38,7 @@ namespace Flowframes.Main bool firstProgUpd = true; Program.mainForm.SetProgress(0); targetFrames = target; + Logger.Log("Skipping progress count because program is not busy!!", true); while (Program.busy) { if (AiProcess.processTime.IsRunning && Directory.Exists(outdir)) diff --git a/Code/OS/AiProcess.cs b/Code/OS/AiProcess.cs index d3bc156..0c69949 100644 --- a/Code/OS/AiProcess.cs +++ b/Code/OS/AiProcess.cs @@ -184,7 +184,7 @@ namespace Flowframes public static async Task RunRifeNcnnMulti(string framesPath, string outPath, int tilesize, int times) { processTimeMulti.Restart(); - Logger.Log($"Running RIFE{(InterpolateUtils.UseUHD() ? " (UHD Mode)" : "")} ...", false); + Logger.Log($"Running RIFE{(InterpolateUtils.UseUHD() ? " (UHD Mode)" : "")}...", false); bool useAutoEnc = Interpolate.currentlyUsingAutoEnc; if(times > 2)