summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-02-23 14:17:29 +0000
committersr55 <[email protected]>2020-02-23 20:02:53 +0000
commitd740d51cfedba30e5ed355fbe9e93f32b1666bec (patch)
tree4991bc491e659dce1977f67344ce1fdc0b504b96 /win/CS
parent3ba128c5553ff925ac1f4d43c77c1ca7c350417c (diff)
WinGui: Fix an issue with Queue Pause/Resume not working correctly and some unhandled silent exceptions in the libhb wrapper library. Fixes #2647
(cherry picked from commit 4083aca9d94a7fd58b400b3744a35bfc233cdf5d)
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs12
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/QueueService.cs4
2 files changed, 14 insertions, 2 deletions
diff --git a/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs
index 69bf56155..34997f0ce 100644
--- a/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs
@@ -470,8 +470,16 @@ namespace HandBrake.Interop.Interop
{
if (this.EncodeProgress != null)
{
- TimeSpan eta = TimeSpan.FromSeconds(state.Working.ETASeconds);
- var progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, eta, state.Working.PassID, state.Working.Pass, state.Working.PassCount, taskState.Code);
+ TimeSpan eta = TimeSpan.FromSeconds(state?.Working?.ETASeconds ?? 0);
+ var progressEventArgs = new EncodeProgressEventArgs(0, 0, 0, TimeSpan.MinValue, 0, 0, 0, taskState.Code);
+ if (taskState == TaskState.Muxing || state.Working == null)
+ {
+ progressEventArgs = new EncodeProgressEventArgs(100, 0, 0, TimeSpan.MinValue, 0, 0, 0, taskState.Code);
+ }
+ else
+ {
+ progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, eta, state.Working.PassID, state.Working.Pass, state.Working.PassCount, taskState.Code);
+ }
this.EncodeProgress(this, progressEventArgs);
}
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
index 5db4af3f7..f4dc26fb0 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
@@ -410,6 +410,10 @@ namespace HandBrakeWPF.Services.Queue
{
this.ProcessNextJob();
}
+ else
+ {
+ this.IsProcessing = true;
+ }
}
public void Stop()