diff options
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs')
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs index 1e6329db1..e46afea28 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Parser.cs @@ -36,7 +36,7 @@ namespace HandBrake.ApplicationServices.Parsing /// <param name="currentFps">The current encoding fps</param>
/// <param name="averageFps">The average encoding fps for this task</param>
/// <param name="timeRemaining">The estimated time remaining for this task to complete</param>
- public delegate void EncodeProgressEventHandler(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float averageFps, TimeSpan timeRemaining);
+ public delegate void EncodeProgressEventHandler(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float averageFps, string timeRemaining);
/// <summary>
/// A simple wrapper around a StreamReader to keep track of the entire output from a cli process
@@ -124,7 +124,6 @@ namespace HandBrake.ApplicationServices.Parsing string tmp = base.ReadToEnd();
buffer.Append(tmp + Environment.NewLine);
-
if (OnReadToEnd != null)
OnReadToEnd(this, tmp);
@@ -147,11 +146,16 @@ namespace HandBrake.ApplicationServices.Parsing float percent = float.Parse(m.Groups[3].Value, culture);
float currentFps = m.Groups[5].Value == string.Empty ? 0.0F : float.Parse(m.Groups[5].Value, culture);
float avgFps = m.Groups[6].Value == string.Empty ? 0.0F : float.Parse(m.Groups[6].Value, culture);
- TimeSpan remaining = TimeSpan.Zero;
+ string remaining = string.Empty;
if (m.Groups[7].Value != string.Empty)
{
- remaining = TimeSpan.Parse(m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value);
+ remaining = m.Groups[7].Value + ":" + m.Groups[8].Value + ":" + m.Groups[9].Value;
+ }
+ if (string.IsNullOrEmpty(remaining))
+ {
+ remaining = "Calculating ...";
}
+
OnEncodeProgress(this, currentTask, totalTasks, percent, currentFps, avgFps, remaining);
}
}
|