/// <param name="currentFps">The current encoding fps</param>\r
/// <param name="averageFps">The average encoding fps for this task</param>\r
/// <param name="timeRemaining">The estimated time remaining for this task to complete</param>\r
- public delegate void EncodeProgressEventHandler(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float averageFps, TimeSpan timeRemaining);\r
+ public delegate void EncodeProgressEventHandler(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float averageFps, string timeRemaining);\r
\r
/// <summary>\r
/// A simple wrapper around a StreamReader to keep track of the entire output from a cli process\r
string tmp = base.ReadToEnd();\r
\r
buffer.Append(tmp + Environment.NewLine);\r
-\r
if (OnReadToEnd != null)\r
OnReadToEnd(this, tmp);\r
\r
float percent = float.Parse(m.Groups[3].Value, culture);\r
float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value, culture);\r
float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value, culture);\r
- TimeSpan remaining = TimeSpan.Zero;\r
+ string remaining = string.Empty;\r
if (m.Groups[7].Value != string.Empty)\r
{\r
- remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);\r
+ remaining = m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value;\r
+ }\r
+ if (string.IsNullOrEmpty(remaining))\r
+ {\r
+ remaining = "Calculating ...";\r
}\r
+\r
OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);\r
}\r
}\r
/// <param name="currentFps">Current encode speed in fps</param>\r
/// <param name="avg">Avg encode speed</param>\r
/// <param name="timeRemaining">Time Left</param>\r
- private void EncodeOnEncodeProgress(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float avg, TimeSpan timeRemaining)\r
+ private void EncodeOnEncodeProgress(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float avg, string timeRemaining)\r
{\r
EncodeProgressEventArgs eventArgs = new EncodeProgressEventArgs\r
{\r