From 7fd562be2ccd28fc61ffd9df259b7f03f6c2db0d Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Mon, 1 Mar 2021 18:32:55 +0100 Subject: [PATCH] (Hopefully) fixed bug where videos with ((n % 100 == 0) + 2) frames were cut off by 2 in-frames --- Code/Main/FrameOrder.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Code/Main/FrameOrder.cs b/Code/Main/FrameOrder.cs index 340aa34..90bb2bb 100644 --- a/Code/Main/FrameOrder.cs +++ b/Code/Main/FrameOrder.cs @@ -8,7 +8,6 @@ using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; -using System.Text; using System.Threading.Tasks; namespace Flowframes.Main @@ -86,17 +85,18 @@ namespace Flowframes.Main sceneFrames = Directory.GetFiles(scnFramesPath).Select(file => Path.GetFileNameWithoutExtension(file)).ToList(); bool debug = Config.GetBool("frameOrderDebug", false); - int interpFramesAmount = (int)interpFactor; // TODO: This code won't work with fractional factors - List tasks = new List(); int linesPerTask = 400 / (int)interpFactor; int num = 0; - for (int i = 0; i < (frameFilesWithoutLast.Length - 1); i+= linesPerTask) + Logger.Log($"frameFiles.Length: {frameFiles.Length} - frameFilesWithoutLast.Length: {frameFilesWithoutLast.Length}"); + + for (int i = 0; i < frameFilesWithoutLast.Length; i+= linesPerTask) { tasks.Add(GenerateFrameLines(num, i, linesPerTask, (int)interpFactor, loopEnabled, sceneDetection, debug)); num++; + Logger.Log($"Added frame order task {num} starting at {i}, {linesPerTask} lines"); } await Task.WhenAll(tasks);