]> granicus.if.org Git - handbrake/commitdiff
WinGui: Small bug fix to handling of queue recovery when running mulitple instances...
authorsr55 <sr55.hb@outlook.com>
Sat, 18 Apr 2015 15:43:57 +0000 (15:43 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 18 Apr 2015 15:43:57 +0000 (15:43 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7098 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/CS/HandBrakeWPF/Helpers/QueueRecoveryHelper.cs

index d2d9f13223828baeb1e20cb5d04d8f28823bf668..57033ae9d5fa9c7617c4ff5b426f5b63590e68ad 100644 (file)
@@ -126,7 +126,21 @@ namespace HandBrakeWPF.Helpers
             {\r
                 foreach (string file in queueFiles)\r
                 {\r
-                    encodeQueue.RestoreQueue(appDataPath + file); // Start Recovery\r
+                    // Skip over the file if it belongs to another HandBrake instance.\r
+                    Match m = Regex.Match(file, @"([0-9]+).xml");\r
+                    if (m.Success)\r
+                    {\r
+                        int processId = int.Parse(m.Groups[1].ToString());\r
+                        if (processId != GeneralUtilities.ProcessId && GeneralUtilities.IsPidACurrentHandBrakeInstance(processId))\r
+                        {\r
+                            continue;\r
+                        }\r
+                    }\r
+\r
+                    // Recover the Queue\r
+                    encodeQueue.RestoreQueue(appDataPath + file); \r
+\r
+                    // Cleanup\r
                     if (!file.Contains(GeneralUtilities.ProcessId.ToString(CultureInfo.InvariantCulture)))\r
                     {\r
                         try\r