private void MultiPass(string[] arguments) { int passes = arguments.Length; _ffmpegProcess = new FFmpeg(arguments[currentPass]); _ffmpegProcess.Process.ErrorDataReceived += ProcessOnErrorDataReceived; _ffmpegProcess.Process.OutputDataReceived += ProcessOnOutputDataReceived; _ffmpegProcess.Process.Exited += (o, args) => textBoxOutput.Invoke((Action)(() => { if (_panic) { return; //This should stop that one exception when closing the converter } textBoxOutput.AppendText("\n--- FFMPEG HAS EXITED ---"); currentPass++; if (currentPass < passes && !_cancelMultipass) { textBoxOutput.AppendText(string.Format("\n--- ENTERING PASS {0} ---", currentPass + 1)); MultiPass(arguments); //Sort of recursion going on here, be careful with stack overflows and shit return; } buttonCancel.Enabled = false; _timer = new Timer(); _timer.Interval = 500; _timer.Tick += Exited; _timer.Start(); })); _ffmpegProcess.Start(); }
private void SinglePass(string argument) { _ffmpegProcess = new FFmpeg(argument); _ffmpegProcess.Process.ErrorDataReceived += ProcessOnErrorDataReceived; _ffmpegProcess.Process.OutputDataReceived += ProcessOnOutputDataReceived; _ffmpegProcess.Process.Exited += (o, args) => textBoxOutput.Invoke((Action)(() => { if (_panic) { return; //This should stop that one exception when closing the converter } textBoxOutput.AppendText("\n--- FFMPEG HAS EXITED ---"); buttonCancel.Enabled = false; _timer = new Timer(); _timer.Interval = 500; _timer.Tick += Exited; _timer.Start(); })); _ffmpegProcess.Start(); }
private void SinglePass(string argument) { _ffmpegProcess = new FFmpeg(argument); _ffmpegProcess.Process.ErrorDataReceived += ProcessOnErrorDataReceived; _ffmpegProcess.Process.OutputDataReceived += ProcessOnOutputDataReceived; _ffmpegProcess.Process.Exited += (o, args) => textBoxOutput.Invoke((Action)(() => { if (_panic) return; //This should stop that one exception when closing the converter textBoxOutput.AppendText("\n--- FFMPEG HAS EXITED ---"); buttonCancel.Enabled = false; _timer = new Timer(); _timer.Interval = 500; _timer.Tick += Exited; _timer.Start(); })); _ffmpegProcess.Start(); }
private void MultiPass(string[] arguments) { int passes = arguments.Length; _ffmpegProcess = new FFmpeg(arguments[currentPass]); _ffmpegProcess.Process.ErrorDataReceived += ProcessOnErrorDataReceived; _ffmpegProcess.Process.OutputDataReceived += ProcessOnOutputDataReceived; _ffmpegProcess.Process.Exited += (o, args) => textBoxOutput.Invoke((Action)(() => { if (_panic) return; //This should stop that one exception when closing the converter textBoxOutput.AppendText("\n--- FFMPEG HAS EXITED ---"); currentPass++; if (currentPass < passes && !_cancelMultipass) { textBoxOutput.AppendText(string.Format("\n--- ENTERING PASS {0} ---", currentPass + 1)); MultiPass(arguments); //Sort of recursion going on here, be careful with stack overflows and shit return; } buttonCancel.Enabled = false; _timer = new Timer(); _timer.Interval = 500; _timer.Tick += Exited; _timer.Start(); })); _ffmpegProcess.Start(); }