diff options
author | sr55 <[email protected]> | 2008-10-23 21:01:24 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-10-23 21:01:24 +0000 |
commit | 6940288cd19ed2a4dcfbd9d82587ec1fd939b06a (patch) | |
tree | 1b69b9b67f4240d0092d2117f0b3d65653efeb3b | |
parent | f2910e72629518720d68097bdd0989fda198055d (diff) |
WinGui:
- Hack to fix a bug introduced in 1819. Level 1 verbose caused an arithmetic error with sr.Peek().
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1864 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/Parsing/Title.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/win/C#/Parsing/Title.cs b/win/C#/Parsing/Title.cs index a2205fcb7..c2a21b86b 100644 --- a/win/C#/Parsing/Title.cs +++ b/win/C#/Parsing/Title.cs @@ -181,8 +181,8 @@ namespace Handbrake.Parsing public static Title[] ParseList(string output)
{
List<Title> titles = new List<Title>();
-
StringReader sr = new StringReader(output);
+
while ((char)sr.Peek() == '+')
{
titles.Add(Title.Parse(sr));
@@ -190,10 +190,22 @@ namespace Handbrake.Parsing * Fix for the line "+ combing detected, may be interlaced or telecined"
* If the next character is not a [ or +, then there are titles left to parse, but we are not where
* we expect to be in the output, so read one line ahead to skip over the unknown line
+ *
+ * HACK: FIX THIS PROPERLY
+ * The try cactch is used to fix a bug introduced with 1819. The level of verbosity needs to be 2
+ * in order for the code to run correctly without the hack below. It gets upset about 2 lines of
+ * log missing with -v 1. To fix this just break out the loop so that sr.Peek() isn't run.
*/
+ try
+ {
+ if ((char)sr.Peek() != '[' && (char)sr.Peek() != '+') // Hack, Fix later
+ sr.ReadLine();
+ }
+ catch (Exception)
+ {
+ break;
+ }
- if ((char)sr.Peek() != '[' && (char)sr.Peek() != '+' ) // Hack, Fix later
- sr.ReadLine();
}
return titles.ToArray();
|