Little changes

This commit is contained in:
Jaex 2014-06-04 14:44:37 +03:00
parent 2b64b6c19c
commit 2529c8be88
2 changed files with 5 additions and 5 deletions

View file

@ -52,11 +52,12 @@ public virtual int Open(string path, string args = null)
psi.WorkingDirectory = Path.GetDirectoryName(path);
process.EnableRaisingEvents = true;
process.OutputDataReceived += cli_OutputDataReceived;
process.ErrorDataReceived += cli_ErrorDataReceived;
if (psi.RedirectStandardOutput) process.OutputDataReceived += cli_OutputDataReceived;
if (psi.RedirectStandardError) process.ErrorDataReceived += cli_ErrorDataReceived;
process.StartInfo = psi;
process.Start();
process.BeginErrorReadLine();
if (psi.RedirectStandardOutput) process.BeginOutputReadLine();
if (psi.RedirectStandardError) process.BeginErrorReadLine();
process.WaitForExit();
return process.ExitCode;
}

View file

@ -66,8 +66,7 @@ public string GetFFmpegCommands()
int lastIndex = commands.LastIndexOf('"');
if (lastIndex >= 0)
{
commands = commands.Remove(lastIndex);
lastIndex = commands.LastIndexOf('"');
lastIndex = commands.LastIndexOf('"', lastIndex - 1);
if (lastIndex >= 0)
{
commands = commands.Remove(lastIndex);