From: sr55 Date: Wed, 3 Oct 2018 20:05:06 +0000 (+0100) Subject: WinGui: Fix an issue that might be causing the default sample rate to be selected... X-Git-Tag: 1.2.0~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cee90c5e1f67822eeda314214028e59b4adcfdac;p=handbrake WinGui: Fix an issue that might be causing the default sample rate to be selected instead of auto. #1618 --- 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. /// ///