OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 7 Nov 2008 22:28:57 +0000 (22:28 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 7 Nov 2008 22:28:57 +0000 (22:28 +0000)
- Fix for the "frmReadDVD.cs - startProc()System.OverflowException:Arithmetic operation resulted in an overflow" error in Title.cs

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

win/C#/Parsing/Title.cs

index c2a21b8..05521c0 100644 (file)
@@ -148,7 +148,7 @@ namespace Handbrake.Parsing
             if (m.Success)\r
                 thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());\r
 \r
-            output.ReadLine();\r
+            String testData = output.ReadLine();\r
 \r
             // Get duration for this title\r
 \r
@@ -183,29 +183,13 @@ namespace Handbrake.Parsing
             List<Title> titles = new List<Title>();\r
             StringReader sr = new StringReader(output);\r
 \r
-            while ((char)sr.Peek() == '+')\r
+            while (sr.Peek() == '+' || sr.Peek() == ' ')\r
             {\r
-                titles.Add(Title.Parse(sr));\r
-                /*\r
-                 * Fix for the line "+ combing detected, may be interlaced or telecined"\r
-                 * If the next character is not a [ or +, then there are titles left to parse, but we are not where\r
-                 * we expect to be in the output, so read one line ahead to skip over the unknown line\r
-                 * \r
-                 * HACK: FIX THIS PROPERLY\r
-                 * The try cactch is used to fix a bug introduced with 1819. The level of verbosity needs to be 2\r
-                 * in order for the code to run correctly without the hack below. It gets upset about 2 lines of\r
-                 * log missing with -v 1. To fix this just break out the loop so that sr.Peek() isn't run.\r
-                 */\r
-                try\r
-                {\r
-                    if ((char)sr.Peek() != '[' && (char)sr.Peek() != '+') // Hack, Fix later\r
-                        sr.ReadLine();\r
-                }\r
-                catch (Exception)\r
-                {\r
-                    break;\r
-                }\r
-\r
+                // If the the character is a space, then chances are the line\r
+                if (sr.Peek() == ' ') // If the character is a space, then chances are it's the combing detected line.\r
+                    sr.ReadLine(); // Skip over it\r
+                else\r
+                    titles.Add(Title.Parse(sr));              \r
             }\r
 \r
             return titles.ToArray();\r