]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Thu, 20 Dec 2007 18:22:52 +0000 (18:22 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 20 Dec 2007 18:22:52 +0000 (18:22 +0000)
- Removed excess debug code in Title.cs. Haven't heard any complaints since 0.9.1 so It seems the problems are gone.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1142 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Parsing/Title.cs

index 8f5d0c05a71ff72c9483868e0b185040dc4b7749..0cfbff3f86fe16f871b7d3fe9f5be12e553398c2 100644 (file)
@@ -133,106 +133,48 @@ namespace Handbrake.Parsing
              this.m_duration.Minutes, this.m_duration.Seconds);\r
         }\r
 \r
-\r
-        /*\r
-         * \r
-         * There is some pretty extensive exception handling in here. A number of people have been seeing random problems.\r
-         * It just helps pinpointing which line of code is causing the issue.\r
-         * Can be cut down at a later date.\r
-         * \r
-         */\r
         public static Title Parse(StringReader output)\r
         {\r
             Title thisTitle = new Title();\r
             try\r
             {\r
                 Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");\r
-                try\r
-                {\r
-                    // Match track number for this title\r
-                    if (m.Success)\r
-                        thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Track Number " + exc.ToString());\r
-                }\r
+                // Match track number for this title\r
+                if (m.Success)\r
+                    thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());\r
 \r
                 output.ReadLine();\r
 \r
                 // Get duration for this title\r
-                try\r
-                {\r
-                    m = Regex.Match(output.ReadLine(), @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
-                    if (m.Success)\r
-                        thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Duration " + exc.ToString());\r
-                }\r
 \r
-                try\r
-                {\r
-                    // Get resolution, aspect ratio and FPS for this title\r
-                    m = Regex.Match(output.ReadLine(), @"^  \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
-                    if (m.Success)\r
-                    {\r
-                        thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
-                        thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);\r
-                    }\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());\r
-                }\r
+                m = Regex.Match(output.ReadLine(), @"^  \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");\r
+                if (m.Success)\r
+                    thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);\r
 \r
-                try\r
-                {\r
-                    // Get autocrop region for this title\r
-                    m = Regex.Match(output.ReadLine(), @"^  \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");\r
-                    if (m.Success)\r
-                        thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };\r
-                }\r
-                catch (Exception exc)\r
+                // Get resolution, aspect ratio and FPS for this title\r
+                m = Regex.Match(output.ReadLine(), @"^  \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");\r
+                if (m.Success)\r
                 {\r
-                    MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());\r
+                    thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));\r
+                    thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);\r
                 }\r
 \r
+                // Get autocrop region for this title\r
+                m = Regex.Match(output.ReadLine(), @"^  \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");\r
+                if (m.Success)\r
+                    thisTitle.m_autoCrop = new int[4] { int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value), int.Parse(m.Groups[4].Value) };\r
 \r
-                try\r
-                {\r
-                    thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Chapters EXC " + exc.ToString());\r
-                }\r
+                thisTitle.m_chapters.AddRange(Chapter.ParseList(output));\r
 \r
-                try\r
-                {\r
-                    thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Audio EXC " + exc.ToString());\r
-                }\r
+                thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));\r
 \r
-                try\r
-                {\r
-                    thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
-                }\r
-                catch (Exception exc)\r
-                {\r
-                    MessageBox.Show("Title.cs - Subtitles EXC " + exc.ToString());\r
-                }\r
+                thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));\r
             }\r
             catch (Exception exc)\r
             {\r
                 MessageBox.Show("Title.cs - Parse " + exc.ToString());\r
             }\r
 \r
-\r
             return thisTitle;\r
         }\r
 \r