summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
index d2d9f1322..57033ae9d 100644
--- a/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs
@@ -126,7 +126,21 @@ namespace HandBrakeWPF.Helpers
{
foreach (string file in queueFiles)
{
- encodeQueue.RestoreQueue(appDataPath + file); // Start Recovery
+ // Skip over the file if it belongs to another HandBrake instance.
+ Match m = Regex.Match(file, @"([0-9]+).xml");
+ if (m.Success)
+ {
+ int processId = int.Parse(m.Groups[1].ToString());
+ if (processId != GeneralUtilities.ProcessId && GeneralUtilities.IsPidACurrentHandBrakeInstance(processId))
+ {
+ continue;
+ }
+ }
+
+ // Recover the Queue
+ encodeQueue.RestoreQueue(appDataPath + file);
+
+ // Cleanup
if (!file.Contains(GeneralUtilities.ProcessId.ToString(CultureInfo.InvariantCulture)))
{
try