private void FFmpeg_Completed(object sender, FFmpeg.CompletedEventArgs e)
 {
     if (manager.AppExited)
     {
         return;
     }
     Dispatcher.Invoke(() => {
         FFmpegProcess Proc = sender as FFmpegProcess;
         if (e.Status == CompletionStatus.Error && !Proc.WorkProcess.StartInfo.FileName.EndsWith("avs2yuv.exe"))
         {
             FFmpegErrorWindow.Instance(Owner, Proc);
         }
         // hosts.Remove(Proc);
         if (Proc == task)
         {
             task = null;
             TaskStatusText.Text = "";
         }
         if (autoClose && !HasRunningHosts)
         {
             ClosingState = 2;
             this.Close();
         }
     });
 }
 public override void DisplayError(FFmpegProcess host)
 {
     Application.Current.Dispatcher.Invoke(() => FFmpegErrorWindow.Instance(parent, host));
 }