diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs | 12 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Queue/QueueService.cs | 4 |
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() |