diff options
author | sr55 <[email protected]> | 2010-09-11 15:36:32 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2010-09-11 15:36:32 +0000 |
commit | 716a835052599eec774e1c0fb5be76e6a6ae3836 (patch) | |
tree | 6837156c4595d9e35d8ea8f9537a16148686b13c | |
parent | eea2d6d22cf6f03701e313b2a2f1bd509a7705ba (diff) |
WinGui:
- Further fixes to the Title parser to deal with changes made for blu-ray support.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3514 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | win/C#/HandBrake.ApplicationServices/Parsing/Title.cs | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs index bca98142a..3f165ded5 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs @@ -116,30 +116,40 @@ namespace HandBrake.ApplicationServices.Parsing public static Title Parse(StringReader output)
{
var thisTitle = new Title();
+ string nextLine = output.ReadLine();
- Match m = Regex.Match(output.ReadLine(), @"^\+ title ([0-9]*):");
- // Match track number for this title
+ // Get the Title Number
+ Match m = Regex.Match(nextLine, @"^\+ title ([0-9]*):");
if (m.Success)
thisTitle.TitleNumber = int.Parse(m.Groups[1].Value.Trim());
+ nextLine = output.ReadLine();
- // If we are scanning a groupd of files, we'll want to get the source name.
- string path = output.ReadLine();
-
- m = Regex.Match(path, @" \+ Main Feature");
+ // Detect if this is the main feature
+ m = Regex.Match(nextLine, @" \+ Main Feature");
if (m.Success)
{
thisTitle.MainTitle = true;
- path = output.ReadLine();
+ nextLine = output.ReadLine();
}
- m = Regex.Match(path, @"^ \+ stream:");
+ // Get the stream name for file import
+ m = Regex.Match(nextLine, @"^ \+ stream:");
if (m.Success)
- thisTitle.SourceName = path.Replace("+ stream:", string.Empty).Trim();
+ {
+ thisTitle.SourceName = nextLine.Replace("+ stream:", string.Empty).Trim();
+ nextLine = output.ReadLine();
+ }
- string nextLine = output.ReadLine();
+ // Jump over the VTS and blocks line
+ m = Regex.Match(nextLine, @"^ \+ vts:");
+ if (nextLine.Contains("blocks") || nextLine.Contains("+ vts "))
+ {
+ nextLine = output.ReadLine();
+ }
+
+ // Multi-Angle Support if LibDvdNav is enabled
if (!Init.DisableDvdNav)
{
- // Get the Angles for the title.
m = Regex.Match(nextLine, @" \+ angle\(s\) ([0-9])");
if (m.Success)
{
|