From 988fc7eb5bb797a65353644f51d9dc5fc4c0e236 Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 20 Mar 2013 20:50:58 +0000 Subject: WinGui: Fix a bug in the scan engine that caused problems with multi-angle discs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5352 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Parsing/Chapter.cs | 5 ++--- .../HandBrake.ApplicationServices/Parsing/Title.cs | 21 +++++++++------------ 2 files changed, 11 insertions(+), 15 deletions(-) (limited to 'win') diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs index eb0313317..00870552f 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Chapter.cs @@ -72,9 +72,8 @@ namespace HandBrake.ApplicationServices.Parsing public static Chapter Parse(StringReader output) { // TODO add support for reading chapter names to the regex. - Match m = Regex.Match( - output.ReadLine(), - @"^ \+ ([0-9]*): cells ([0-9]*)->([0-9]*), ([0-9]*) blocks, duration ([0-9]{2}:[0-9]{2}:[0-9]{2})"); + string line = output.ReadLine(); + Match m = Regex.Match(line, @"^ \+ ([0-9]*): cells ([0-9]*)->([0-9]*), ([0-9]*) blocks, duration ([0-9]{2}:[0-9]{2}:[0-9]{2})"); if (m.Success) { var thisChapter = new Chapter diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs index f834c4fa9..af5788f41 100644 --- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs @@ -167,20 +167,17 @@ namespace HandBrake.ApplicationServices.Parsing { nextLine = output.ReadLine(); } - + // Multi-Angle Support if LibDvdNav is enabled - if (!isDvdNavDisabled) + m = Regex.Match(nextLine, @" \+ angle\(s\) ([0-9]*)"); + if (m.Success) { - m = Regex.Match(nextLine, @" \+ angle\(s\) ([0-9])"); - if (m.Success) - { - string angleList = m.Value.Replace("+ angle(s) ", string.Empty).Trim(); - int angleCount; - int.TryParse(angleList, out angleCount); - - thisTitle.AngleCount = angleCount; - nextLine = output.ReadLine(); - } + string angleList = m.Value.Replace("+ angle(s) ", string.Empty).Trim(); + int angleCount; + int.TryParse(angleList, out angleCount); + + thisTitle.AngleCount = angleCount; + nextLine = output.ReadLine(); } // Get duration for this title -- cgit v1.2.3