summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2007-12-20 18:22:52 +0000
committersr55 <[email protected]>2007-12-20 18:22:52 +0000
commitdb87f9868ce76364745742cd3a056dbc909b463f (patch)
tree978b4b9ed1a0e715710f1278e90d2742e8d503f7 /win
parent497e1b008f2ad22b2a67405e53edd047167a398a (diff)
WinGui:
- 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
Diffstat (limited to 'win')
-rw-r--r--win/C#/Parsing/Title.cs94
1 files changed, 18 insertions, 76 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs
index 8f5d0c05a..0cfbff3f8 100644
--- a/win/C#/Parsing/Title.cs
+++ b/win/C#/Parsing/Title.cs
@@ -133,106 +133,48 @@ namespace Handbrake.Parsing
this.m_duration.Minutes, this.m_duration.Seconds);
}
-
- /*
- *
- * There is some pretty extensive exception handling in here. A number of people have been seeing random problems.
- * It just helps pinpointing which line of code is causing the issue.
- * Can be cut down at a later date.
- *
- */
public static Title Parse(StringReader output)
{
Title thisTitle = new Title();
try
{
Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");
- try
- {
- // Match track number for this title
- if (m.Success)
- thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Track Number " + exc.ToString());
- }
+ // Match track number for this title
+ if (m.Success)
+ thisTitle.m_titleNumber = int.Parse(m.Groups[1].Value.Trim().ToString());
output.ReadLine();
// Get duration for this title
- try
- {
- m = Regex.Match(output.ReadLine(), @"^ \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");
- if (m.Success)
- thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Duration " + exc.ToString());
- }
- try
- {
- // Get resolution, aspect ratio and FPS for this title
- m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");
- if (m.Success)
- {
- thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
- thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);
- }
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Resolution and Aspect " + exc.ToString());
- }
+ m = Regex.Match(output.ReadLine(), @"^ \+ duration: ([0-9]{2}:[0-9]{2}:[0-9]{2})");
+ if (m.Success)
+ thisTitle.m_duration = TimeSpan.Parse(m.Groups[1].Value);
- try
- {
- // Get autocrop region for this title
- m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");
- if (m.Success)
- 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) };
- }
- catch (Exception exc)
+ // Get resolution, aspect ratio and FPS for this title
+ m = Regex.Match(output.ReadLine(), @"^ \+ size: ([0-9]*)x([0-9]*), aspect: ([0-9]*\.[0-9]*), ([0-9]*\.[0-9]*) fps");
+ if (m.Success)
{
- MessageBox.Show("Title.cs - Auto Crop " + exc.ToString());
+ thisTitle.m_resolution = new Size(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value));
+ thisTitle.m_aspectRatio = float.Parse(m.Groups[3].Value, Functions.CLI.Culture);
}
+ // Get autocrop region for this title
+ m = Regex.Match(output.ReadLine(), @"^ \+ autocrop: ([0-9]*)/([0-9]*)/([0-9]*)/([0-9]*)");
+ if (m.Success)
+ 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) };
- try
- {
- thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Chapters EXC " + exc.ToString());
- }
+ thisTitle.m_chapters.AddRange(Chapter.ParseList(output));
- try
- {
- thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Audio EXC " + exc.ToString());
- }
+ thisTitle.m_audioTracks.AddRange(AudioTrack.ParseList(output));
- try
- {
- thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
- }
- catch (Exception exc)
- {
- MessageBox.Show("Title.cs - Subtitles EXC " + exc.ToString());
- }
+ thisTitle.m_subtitles.AddRange(Subtitle.ParseList(output));
}
catch (Exception exc)
{
MessageBox.Show("Title.cs - Parse " + exc.ToString());
}
-
return thisTitle;
}