summaryrefslogtreecommitdiffstats
path: root/win/C#/Parsing/AudioTrack.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Parsing/AudioTrack.cs')
-rw-r--r--win/C#/Parsing/AudioTrack.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/win/C#/Parsing/AudioTrack.cs b/win/C#/Parsing/AudioTrack.cs
index c4e1bbc22..56a35194b 100644
--- a/win/C#/Parsing/AudioTrack.cs
+++ b/win/C#/Parsing/AudioTrack.cs
@@ -99,6 +99,8 @@ namespace Handbrake.Parsing
Match bitrate = Regex.Match(audio_track, @"([0-9]*)bps");
string subformat = m.Groups[4].Value.Trim().Contains("iso639") ? null : m.Groups[4].Value;
+ string samplerateVal = samplerate.Success ? samplerate.Groups[0].Value.Replace("Hz", "").Trim() : "0";
+ string bitrateVal = bitrate.Success ? bitrate.Groups[0].Value.Replace("bps", "").Trim() : "0";
if (track.Success)
{
@@ -108,8 +110,8 @@ namespace Handbrake.Parsing
m_language = track.Groups[2].Value,
m_format = m.Groups[3].Value,
m_subFormat = subformat,
- m_frequency = int.Parse(samplerate.Groups[0].Value.Replace("Hz","").Trim()),
- m_bitrate = int.Parse(bitrate.Groups[0].Value.Replace("bps","").Trim()),
+ m_frequency = int.Parse(samplerateVal),
+ m_bitrate = int.Parse(bitrateVal),
m_iso639_2 = iso639_2.Value.Replace("iso639-2: ", "").Replace(")", "")
};
return thisTrack;