From 36c4b34ba05bd1992f0f8757c1b804ca6f2ca4c8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sat, 8 Dec 2012 12:28:17 +0000 Subject: [PATCH] WinGui: When we have a variable framerate preset, reset to "same as source" rather than just remaining at whatever fps was set previously. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5090 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs | 2 +- win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 9511de2ae..273a2f6d5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -1875,7 +1875,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture)); int value; - if (int.TryParse(this.MinLength.ToString(), out value)) + if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value)) { this.userSettingService.SetUserSetting(ASUserSettingConstants.MinScanDuration, value); } diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 888afb132..dba17ea7a 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -15,7 +15,6 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro; - using HandBrake.ApplicationServices; using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Model.Encoding; using HandBrake.ApplicationServices.Parsing; @@ -31,6 +30,12 @@ namespace HandBrakeWPF.ViewModels public class VideoViewModel : ViewModelBase, IVideoViewModel { #region Constants and Fields + + /// + /// Same as source constant. + /// + private const string SameAsSource = "Same as source"; + /// /// Backing field for the user setting service. /// @@ -413,10 +418,7 @@ namespace HandBrakeWPF.ViewModels } this.SelectedVideoEncoder = preset.Task.VideoEncoder; - if (preset.Task.Framerate.HasValue) - { - this.SelectedFramerate = preset.Task.Framerate.Value.ToString(CultureInfo.InvariantCulture); - } + this.SelectedFramerate = preset.Task.Framerate.HasValue ? preset.Task.Framerate.Value.ToString(CultureInfo.InvariantCulture) : SameAsSource; this.IsConstantQuantity = preset.Task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality; -- 2.40.0