Fix indentation in FFmpegService

This commit is contained in:
YoshiRulz 2021-10-04 08:23:18 +10:00
parent ef059dbcaa
commit f46ff85287
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 43 additions and 43 deletions

View File

@ -73,51 +73,51 @@ namespace BizHawk.Common
}
ProcessStartInfo oInfo = new ProcessStartInfo(FFmpegPath, sbCmdline.ToString())
{
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
string result = "";
//probably naturally thread-safe...
//make a lock if not
Action<StreamReader,bool> readerloop = (reader,ignore) =>
{
string line = "";
int idx = 0;
for (; ; )
{
int c = reader.Read();
if (c == -1)
break;
else if (c == '\r')
idx = 0;
else if (c == '\n')
{
if(!ignore)
lock(oInfo)
result += line + "\n";
line = "";
idx = 0;
}
else
{
if (idx < line.Length)
line = line.Substring(0, idx) + (char)c + line.Substring(idx + 1);
else
line += (char)c;
idx++;
}
}
UseShellExecute = false,
CreateNoWindow = true,
RedirectStandardOutput = true,
RedirectStandardError = true
};
if(!ignore)
if(line != "")
lock(oInfo)
result += line + "\n"; //not sure about the final \n but i concat it after each finished line so why not.. whatever
};
string result = "";
//probably naturally thread-safe...
//make a lock if not
Action<StreamReader,bool> readerloop = (reader,ignore) =>
{
string line = "";
int idx = 0;
for (; ; )
{
int c = reader.Read();
if (c == -1)
break;
else if (c == '\r')
idx = 0;
else if (c == '\n')
{
if(!ignore)
lock(oInfo)
result += line + "\n";
line = "";
idx = 0;
}
else
{
if (idx < line.Length)
line = line.Substring(0, idx) + (char)c + line.Substring(idx + 1);
else
line += (char)c;
idx++;
}
}
if(!ignore)
if(line != "")
lock(oInfo)
result += line + "\n"; //not sure about the final \n but i concat it after each finished line so why not.. whatever
};
Process proc = Process.Start(oInfo);