diff options
author | sr55 <[email protected]> | 2008-10-02 11:55:10 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2008-10-02 11:55:10 +0000 |
commit | 35fd4ffcdcbea1c402193700cd6400587ee28c2c (patch) | |
tree | 0837f422f88460a24e9ece52d4ed841fa3f4bd8d /win/C#/Parsing/AudioTrack.cs | |
parent | 565cfb93d5aa4a5912e8d63124a423437714fe01 (diff) |
WinGui:
- Query Parser - Regex was failing when the audio track was listed as " + 1, English (AAC)" instead of something like " + 2, English (AC3) (5.1 ch), 48000Hz, 384000bps"
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1800 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/Parsing/AudioTrack.cs')
-rw-r--r-- | win/C#/Parsing/AudioTrack.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/win/C#/Parsing/AudioTrack.cs b/win/C#/Parsing/AudioTrack.cs index e41cae281..129ae78a7 100644 --- a/win/C#/Parsing/AudioTrack.cs +++ b/win/C#/Parsing/AudioTrack.cs @@ -99,7 +99,9 @@ namespace Handbrake.Parsing public static AudioTrack Parse(StringReader output)
{
- Match m = Regex.Match(output.ReadLine(), @"^ \+ ([0-9]*), ([A-Za-z0-9]*) \((.*)\) \((.*)\), ([0-9]*)Hz, ([0-9]*)bps");
+ String audio_track= output.ReadLine();
+ Match m = Regex.Match(audio_track, @"^ \+ ([0-9]*), ([A-Za-z0-9]*) \((.*)\) \((.*)\), ([0-9]*)Hz, ([0-9]*)bps");
+ Match y = Regex.Match(audio_track, @"^ \+ ([0-9]*), ([A-Za-z0-9]*) \((.*)\)");
if (m.Success)
{
AudioTrack thisTrack = new AudioTrack();
@@ -111,6 +113,14 @@ namespace Handbrake.Parsing thisTrack.m_bitrate = int.Parse(m.Groups[6].Value.Trim().ToString());
return thisTrack;
}
+ else if (y.Success)
+ {
+ AudioTrack thisTrack = new AudioTrack();
+ thisTrack.m_trackNumber = int.Parse(y.Groups[1].Value.Trim().ToString());
+ thisTrack.m_language = y.Groups[2].Value;
+ thisTrack.m_format = y.Groups[3].Value;
+ return thisTrack;
+ }
else
return null;
}
|