summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Presets
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Presets')
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs10
-rw-r--r--win/CS/HandBrakeWPF/Services/Presets/PresetService.cs5
2 files changed, 11 insertions, 4 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
index b10b9c19e..8c173c4d0 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs
@@ -449,7 +449,15 @@ namespace HandBrakeWPF.Services.Presets.Factories
track.MixDown = HandBrakeEncoderHelpers.GetMixdown(audioTrack.AudioMixdown);
// track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel;
- track.SampleRate = string.IsNullOrEmpty(audioTrack.AudioSamplerate) || audioTrack.AudioSamplerate.ToLower() == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate);
+
+ if (!string.IsNullOrEmpty(audioTrack.AudioSamplerate) && !"auto".Equals(audioTrack.AudioSamplerate))
+ {
+ double sampleRate = 0;
+ if (double.TryParse(audioTrack.AudioSamplerate, NumberStyles.Any, CultureInfo.InvariantCulture, out sampleRate))
+ {
+ track.SampleRate = sampleRate;
+ }
+ }
track.EncoderRateType = audioTrack.AudioTrackQualityEnable ? AudioEncoderRateType.Quality : AudioEncoderRateType.Bitrate;
track.Quality = audioTrack.AudioTrackQuality;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
index cd4c74e35..a7d4dbefa 100644
--- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
+++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs
@@ -589,9 +589,8 @@ namespace HandBrakeWPF.Services.Presets
{
continue;
}
-
- categoriesList.Add(category);
-
+
+ categoriesList.Add(category);
}
}