diff options
author | sr55 <[email protected]> | 2009-02-22 19:48:14 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2009-02-22 19:48:14 +0000 |
commit | 9c285a3fe71ac86f71e55aac1faff4d8ccc02fb6 (patch) | |
tree | 9844b2c9c25f17c793a690c7125b350e00ee6724 /win/C#/frmMain | |
parent | 51ed8553568294793d0e50e11dc6c80b1f161f02 (diff) |
WinGui:
- Fixes culture issue in the Query Generator and Preset loader. Same issue as previous checkin. Thanks to zhango for pointing this code out with a fix.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2174 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/C#/frmMain')
-rw-r--r-- | win/C#/frmMain/PresetLoader.cs | 18 | ||||
-rw-r--r-- | win/C#/frmMain/QueryGenerator.cs | 6 |
2 files changed, 18 insertions, 6 deletions
diff --git a/win/C#/frmMain/PresetLoader.cs b/win/C#/frmMain/PresetLoader.cs index dd6ee48be..f10b7227d 100644 --- a/win/C#/frmMain/PresetLoader.cs +++ b/win/C#/frmMain/PresetLoader.cs @@ -182,11 +182,19 @@ namespace Handbrake if (presetQuery.VideoEncoder == "H.264 (x264)")
{
int value;
- float presetValue, calculated, x264step;
- float.TryParse(presetQuery.VideoQuality.ToString(), out presetValue);
- float.TryParse(Properties.Settings.Default.x264cqstep, out x264step);
-
- float x = 51 / x264step;
+ System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
+
+ double presetValue, calculated, x264step;
+ double.TryParse(presetQuery.VideoQuality.ToString(),
+ System.Globalization.NumberStyles.Number,
+ culture,
+ out presetValue);
+ double.TryParse(Properties.Settings.Default.x264cqstep,
+ System.Globalization.NumberStyles.Number,
+ culture,
+ out x264step);
+
+ double x = 51 / x264step;
calculated = presetValue / x264step;
calculated = x - calculated;
diff --git a/win/C#/frmMain/QueryGenerator.cs b/win/C#/frmMain/QueryGenerator.cs index a14e3e824..2c0417397 100644 --- a/win/C#/frmMain/QueryGenerator.cs +++ b/win/C#/frmMain/QueryGenerator.cs @@ -219,7 +219,11 @@ namespace Handbrake break;
case "H.264 (x264)":
double divided;
- double.TryParse(Properties.Settings.Default.x264cqstep, out divided);
+ System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
+ double.TryParse(Properties.Settings.Default.x264cqstep,
+ System.Globalization.NumberStyles.Number,
+ culture,
+ out divided);
value = 51 - mainWindow.slider_videoQuality.Value * divided;
value = Math.Round(value, 2);
query += " -q " + value.ToString(new CultureInfo("en-US"));
|