diff options
author | sr55 <[email protected]> | 2017-10-12 20:09:15 +0100 |
---|---|---|
committer | sr55 <[email protected]> | 2017-10-12 20:09:15 +0100 |
commit | 6368739d77656be1532022a41e0c73ba445858be (patch) | |
tree | 64b6059fb545d3f684065dbb85543b3b94779446 /win | |
parent | 82904f720faa3293a013de011702c39a031f414e (diff) |
WinGui: Fix a culture issue with Framerates. Fixes #926
Diffstat (limited to 'win')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 4acbc4c63..62ace3257 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -347,9 +347,20 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.Task.VideoTunes.Add(new VideoTune(item, item));
}
}
- preset.Task.Framerate = importedPreset.VideoFramerate == "auto" || importedPreset.VideoFramerate == "Same as source" || string.IsNullOrEmpty(importedPreset.VideoFramerate)
- ? (double?)null
- : double.Parse(importedPreset.VideoFramerate, CultureInfo.InvariantCulture);
+
+ if (importedPreset.VideoFramerate == "auto" || importedPreset.VideoFramerate == "Same as source" || string.IsNullOrEmpty(importedPreset.VideoFramerate))
+ {
+ preset.Task.Framerate = null;
+ }
+ else
+ {
+ double parsedFramerate;
+ if (double.TryParse(importedPreset.VideoFramerate, NumberStyles.Any, CultureInfo.CurrentCulture, out parsedFramerate) || double.TryParse(importedPreset.VideoFramerate, NumberStyles.Any, CultureInfo.InvariantCulture, out parsedFramerate))
+ {
+ preset.Task.Framerate = parsedFramerate;
+ }
+ }
+
string parsedValue = importedPreset.VideoFramerateMode;
switch (parsedValue)
{
|