From cee90c5e1f67822eeda314214028e59b4adcfdac Mon Sep 17 00:00:00 2001 From: sr55 Date: Wed, 3 Oct 2018 21:05:06 +0100 Subject: [PATCH] WinGui: Fix an issue that might be causing the default sample rate to be selected instead of auto. #1618 --- .../Services/Presets/Factories/JsonPresetFactory.cs | 6 +++++- win/CS/HandBrakeWPF/Services/Presets/PresetService.cs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 3f86e1aa5..b36a83951 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -403,7 +403,11 @@ namespace HandBrakeWPF.Services.Presets.Factories // track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel; - if (!string.IsNullOrEmpty(audioTrack.AudioSamplerate) && !"auto".Equals(audioTrack.AudioSamplerate)) + if ("auto".Equals(audioTrack.AudioSamplerate)) + { + track.SampleRate = 0; + } + else if (!string.IsNullOrEmpty(audioTrack.AudioSamplerate)) { double sampleRate = 0; if (double.TryParse(audioTrack.AudioSamplerate, NumberStyles.Any, CultureInfo.InvariantCulture, out sampleRate)) diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index b851d8a7c..8540c4774 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -608,7 +608,7 @@ namespace HandBrakeWPF.Services.Presets #region Private Helpers /// - /// Recover from a courrpted preset file + /// Recover from a corrupted preset file /// Add .old to the current filename, and delete the current file. /// /// -- 2.40.0