mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-03 02:36:50 +13:00
Little changes
This commit is contained in:
parent
2b64b6c19c
commit
2529c8be88
2 changed files with 5 additions and 5 deletions
|
@ -52,11 +52,12 @@ public virtual int Open(string path, string args = null)
|
||||||
psi.WorkingDirectory = Path.GetDirectoryName(path);
|
psi.WorkingDirectory = Path.GetDirectoryName(path);
|
||||||
|
|
||||||
process.EnableRaisingEvents = true;
|
process.EnableRaisingEvents = true;
|
||||||
process.OutputDataReceived += cli_OutputDataReceived;
|
if (psi.RedirectStandardOutput) process.OutputDataReceived += cli_OutputDataReceived;
|
||||||
process.ErrorDataReceived += cli_ErrorDataReceived;
|
if (psi.RedirectStandardError) process.ErrorDataReceived += cli_ErrorDataReceived;
|
||||||
process.StartInfo = psi;
|
process.StartInfo = psi;
|
||||||
process.Start();
|
process.Start();
|
||||||
process.BeginErrorReadLine();
|
if (psi.RedirectStandardOutput) process.BeginOutputReadLine();
|
||||||
|
if (psi.RedirectStandardError) process.BeginErrorReadLine();
|
||||||
process.WaitForExit();
|
process.WaitForExit();
|
||||||
return process.ExitCode;
|
return process.ExitCode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,8 +66,7 @@ public string GetFFmpegCommands()
|
||||||
int lastIndex = commands.LastIndexOf('"');
|
int lastIndex = commands.LastIndexOf('"');
|
||||||
if (lastIndex >= 0)
|
if (lastIndex >= 0)
|
||||||
{
|
{
|
||||||
commands = commands.Remove(lastIndex);
|
lastIndex = commands.LastIndexOf('"', lastIndex - 1);
|
||||||
lastIndex = commands.LastIndexOf('"');
|
|
||||||
if (lastIndex >= 0)
|
if (lastIndex >= 0)
|
||||||
{
|
{
|
||||||
commands = commands.Remove(lastIndex);
|
commands = commands.Remove(lastIndex);
|
||||||
|
|
Loading…
Reference in a new issue