diff options
Diffstat (limited to 'win/C#')
3 files changed, 10 insertions, 6 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs b/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs index f51b3ab57..8c46f8738 100644 --- a/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs +++ b/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs @@ -30,7 +30,7 @@ namespace HandBrake.ApplicationServices /// <summary>
/// Gets or sets EstimatedTimeLeft.
/// </summary>
- public TimeSpan EstimatedTimeLeft { get; set; }
+ public string EstimatedTimeLeft { get; set; }
/// <summary>
/// Gets or sets Task.
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);
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs index 87b0e0027..09099ba13 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs @@ -498,7 +498,7 @@ namespace HandBrake.ApplicationServices.Services /// <param name="currentFps">Current encode speed in fps</param>
/// <param name="avg">Avg encode speed</param>
/// <param name="timeRemaining">Time Left</param>
- private void EncodeOnEncodeProgress(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float avg, TimeSpan timeRemaining)
+ private void EncodeOnEncodeProgress(object sender, int currentTask, int taskCount, float percentComplete, float currentFps, float avg, string timeRemaining)
{
EncodeProgressEventArgs eventArgs = new EncodeProgressEventArgs
{
|