Fix issues with queue getting stuck waiting for ffmpeg to exit

This commit is contained in:
n00mkrad
2021-12-07 22:22:57 +01:00
parent 7a3c95f6fb
commit cac12dcebc
3 changed files with 43 additions and 15 deletions

View File

@@ -18,6 +18,11 @@ namespace Flowframes
public const string defaultLogName = "sessionlog";
public static long id;
private static string _lastUi = "";
public static string LastUiLine { get { return _lastUi; } }
private static string _lastLog = "";
public static string LastLogLine { get { return _lastLog; } }
public struct LogEntry
{
public string logMessage;
@@ -55,7 +60,14 @@ namespace Flowframes
if (string.IsNullOrWhiteSpace(entry.logMessage))
return;
Console.WriteLine(entry.logMessage);
string msg = entry.logMessage;
_lastLog = msg;
if (!entry.hidden)
_lastUi = msg;
Console.WriteLine(msg);
try
{
@@ -68,21 +80,21 @@ namespace Flowframes
}
catch { }
entry.logMessage = entry.logMessage.Replace("\n", Environment.NewLine);
msg = msg.Replace("\n", Environment.NewLine);
if (!entry.hidden && textbox != null)
textbox.AppendText((textbox.Text.Length > 1 ? Environment.NewLine : "") + entry.logMessage);
textbox.AppendText((textbox.Text.Length > 1 ? Environment.NewLine : "") + msg);
if (entry.replaceLastLine)
{
textbox.Resume();
entry.logMessage = "[REPL] " + entry.logMessage;
msg = "[REPL] " + msg;
}
if (!entry.hidden)
entry.logMessage = "[UI] " + entry.logMessage;
msg = "[UI] " + msg;
LogToFile(entry.logMessage, false, entry.filename);
LogToFile(msg, false, entry.filename);
}
public static void LogToFile(string logStr, bool noLineBreak, string filename)