diff options
author | sr55 <[email protected]> | 2010-07-22 19:05:27 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-07-22 19:05:27 +0000 |
commit | 4bef20d6e23432eeeeaae0d15c1a240780913046 (patch) | |
tree | ef02d5a56e6928ce80bc5442858f7b8ecd71b48f /win/C# | |
parent | b05d02cb320dbec5a60247d87a6c47e6d7b8d456 (diff) |
WinGui:
- Fix an issue that would cause the in-gui encode status to screw up if the encoding time was over 24 hours.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3457 b64f7644-9d1e-0410-96f1-a4d463321fa5
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
{
|