summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.Interop
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.Interop')
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs8
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs2
2 files changed, 8 insertions, 2 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
index eb9353aa7..6833dfc36 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs
@@ -197,7 +197,8 @@ namespace HandBrake.Interop
throw new ArgumentException("height must be positive.");
}
- return HBFunctions.hb_x264_param_unparse(
+ HBFunctions.hb_init(0, 0);
+ IntPtr ptr = HBFunctions.hb_x264_param_unparse(
preset,
string.Join(",", tunes),
extraOptions,
@@ -205,6 +206,11 @@ namespace HandBrake.Interop
level,
width,
height);
+
+ string x264Settings = Marshal.PtrToStringAnsi(ptr);
+
+
+ return x264Settings;
}
/// <summary>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
index cd4ca877d..00130a902 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs
@@ -338,7 +338,7 @@ namespace HandBrake.Interop.HbLib
public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced);
[DllImport("hb.dll", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)]
- public static extern string hb_x264_param_unparse(
+ public static extern IntPtr hb_x264_param_unparse(
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts,