summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Encode
diff options
context:
space:
mode:
authorScott <[email protected]>2015-09-27 17:21:26 +0100
committerScott <[email protected]>2015-09-27 17:21:26 +0100
commiteb1541cf688185a152e1ff1f9b4e8d66eac47ad5 (patch)
tree9740093da634051d7f26d2cdae82fa941309f75f /win/CS/HandBrakeWPF/Services/Encode
parentba9329a59b65fc1f468a83ddc0be8090c69e6863 (diff)
Check Culture of Framerate string
May be the cause of the filter not being set correctly for some users.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Encode')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs27
1 files changed, 15 insertions, 12 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index 10037fc55..0e979f3d9 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -458,21 +458,24 @@ namespace HandBrakeWPF.Services.Encode.Factories
// VFR / CFR
int fm = job.FramerateMode == FramerateMode.CFR ? 1 : job.FramerateMode == FramerateMode.PFR ? 2 : 0;
- IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.Framerate.ToString()); // TODO check culture
- int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
-
- int? num = null;
- int? den = null;
- if (vrate > 0)
+ if (job.Framerate != null)
{
- num = 27000000;
- den = vrate;
- }
+ IntPtr frameratePrt = Marshal.StringToHGlobalAnsi(job.Framerate.Value.ToString(CultureInfo.InvariantCulture));
+ int vrate = HBFunctions.hb_video_framerate_get_from_name(frameratePrt);
+
+ int? num = null;
+ int? den = null;
+ if (vrate > 0)
+ {
+ num = 27000000;
+ den = vrate;
+ }
- string framerateString = num.HasValue ? string.Format("{0}:{1}:{2}", fm, num, den) : string.Format("{0}", fm); // filter_cfr, filter_vrate.num, filter_vrate.den
+ string framerateString = num.HasValue ? string.Format("{0}:{1}:{2}", fm, num, den) : string.Format("{0}", fm); // filter_cfr, filter_vrate.num, filter_vrate.den
- Filter framerateShaper = new Filter { ID = (int)hb_filter_ids.HB_FILTER_VFR, Settings = framerateString };
- filter.FilterList.Add(framerateShaper);
+ Filter framerateShaper = new Filter { ID = (int)hb_filter_ids.HB_FILTER_VFR, Settings = framerateString };
+ filter.FilterList.Add(framerateShaper);
+ }
// Deblock
if (job.Deblock >= 5)