OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 10 Sep 2010 23:38:47 +0000 (23:38 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 10 Sep 2010 23:38:47 +0000 (23:38 +0000)
- Fix for the Title parser. Was expecting "+ angle" to always be there which is no longer the case.

git-svn-id: svn://localhost/HandBrake/trunk@3511 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/HandBrake.ApplicationServices/Parsing/Title.cs

index 4880143..bca9814 100644 (file)
@@ -136,10 +136,11 @@ namespace HandBrake.ApplicationServices.Parsing
             if (m.Success)\r
                 thisTitle.SourceName = path.Replace("+ stream:", string.Empty).Trim();\r
 \r
+            string nextLine = output.ReadLine();\r
             if (!Init.DisableDvdNav)\r
             {\r
                 // Get the Angles for the title.\r
-                m = Regex.Match(output.ReadLine(), @"  \+ angle\(s\) ([0-9])");\r
+                m = Regex.Match(nextLine, @"  \+ angle\(s\) ([0-9])");\r
                 if (m.Success)\r
                 {\r
                     string angleList = m.Value.Replace("+ angle(s) ", string.Empty).Trim();\r
@@ -147,11 +148,12 @@ namespace HandBrake.ApplicationServices.Parsing
                     int.TryParse(angleList, out angleCount);\r
 \r
                     thisTitle.AngleCount = angleCount;\r
+                    nextLine = output.ReadLine();\r
                 }\r
             }\r
 \r
             // Get duration for this title\r
-            m = Regex.Match(output.ReadLine(), @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
+            m = Regex.Match(nextLine, @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
             if (m.Success)\r
                 thisTitle.Duration = TimeSpan.Parse(m.Groups[1].Value);\r
 \r