Esempio n. 1
0
        /// <summary>
        /// handles the encoder process existing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void proc_Exited(object sender, EventArgs e)
        {
            mre.Set();            // Make sure nothing is waiting for pause to stop
            stdoutDone.WaitOne(); // wait for stdout to finish processing
            stderrDone.WaitOne(); // wait for stderr to finish processing

            // check the exitcode
            if (checkExitCode && proc.ExitCode != 0)
            {
                getErrorLine();
                string strError = WindowUtil.GetErrorText(proc.ExitCode);
                if (!su.WasAborted)
                {
                    su.HasError = true;
                    // log.LogEvent("Process exits with error: " + strError, ImageType.Error);
                }
                else
                {
                    // log.LogEvent("Process exits with error: " + strError);
                }
            }

            if (bRunSecondTime)
            {
                bRunSecondTime = false;
                start();
            }
            else
            {
                su.IsComplete = true;
                StatusUpdate(su);
            }

            bWaitForExit = false;
        }
Esempio n. 2
0
        /// <summary>
        /// handles the encoder process existing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void proc_Exited(object sender, EventArgs e)
        {
            mre.Set();  // Make sure nothing is waiting for pause to stop
            if (bCommandLine)
            {
                stdoutDone.WaitOne(); // wait for stdout to finish processing
                stderrDone.WaitOne(); // wait for stderr to finish processing
            }

            getErrorLine();

            // check the exitcode
            if (checkExitCode && !arrSuccessCodes.Contains(proc.ExitCode))
            {
                string strError = WindowUtil.GetErrorText(proc.ExitCode);
                if (!su.WasAborted)
                {
                    su.HasError = true;
                    log.LogEvent("Process exits with error: " + strError, ImageType.Error);
                }
                else
                {
                    log.LogEvent("Process exits with error: " + strError);
                }
            }

            if (secondRunNeeded())
            {
                bFirstPass  = false;
                su.HasError = false;
                start();
            }
            else
            {
                su.Status     = "Finalizing...";
                su.IsComplete = true;
                doExitConfig();
                StatusUpdate(su);
            }

            bWaitForExit = false;
        }
Esempio n. 3
0
        /// <summary>
        /// handles the encoder process existing
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void proc_Exited(object sender, EventArgs e)
        {
            mre.Set();            // Make sure nothing is waiting for pause to stop
            stdoutDone.WaitOne(); // wait for stdout to finish processing
            stderrDone.WaitOne(); // wait for stderr to finish processing

            // check the exitcode because x264.exe sometimes exits with error but without
            // any commandline indication as to why
            if (checkExitCode && proc.ExitCode != 0)
            {
                string strError = WindowUtil.GetErrorText(proc.ExitCode);
                if (!su.WasAborted)
                {
                    su.HasError = true;
                    log.LogEvent("Process exits with error: " + strError, ImageType.Error);
                }
                else
                {
                    log.LogEvent("Process exits with error: " + strError);
                }
            }

            log.LogValue("Standard output stream", stdoutBuilder);
            log.LogValue("Standard error stream", stderrBuilder);

            if (bRunSecondTime)
            {
                stdoutBuilder  = new StringBuilder();
                stderrBuilder  = new StringBuilder();
                bRunSecondTime = false;
                start();
            }
            else
            {
                su.IsComplete = true;
                doExitConfig();
                StatusUpdate(su);
            }
        }