summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs13
-rw-r--r--win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs11
2 files changed, 16 insertions, 8 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
index 8aafbc02d..e46f5b30b 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs
@@ -274,8 +274,8 @@ namespace HandBrake.ApplicationServices.Interop
hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{
crop = new[] { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right },
- itu_par = 0,
- keep = settings.KeepDisplayAspect ? 0x04 : 0,
+ itu_par = 0,
+ keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (settings.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width?
maxWidth = settings.MaxWidth,
maxHeight = settings.MaxHeight,
mode = (int)(hb_anamorphic_mode_t)settings.Anamorphic,
@@ -291,13 +291,10 @@ namespace HandBrake.ApplicationServices.Interop
};
// Sanitize the input.
- Geometry resultGeometry = AnamorphicFactory.CreateGeometry(
- settings,
- new SourceVideoInfo(
- new Size(title.Geometry.Width, title.Geometry.Height),
- new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)));
- int width = resultGeometry.Width;
+ Geometry resultGeometry = AnamorphicFactory.CreateGeometry(settings, new SourceVideoInfo(new Size(title.Geometry.Width, title.Geometry.Height), new Size(title.Geometry.PAR.Num, title.Geometry.PAR.Den)));
+ int width = resultGeometry.Width * resultGeometry.PAR.Num / resultGeometry.PAR.Den;
int height = resultGeometry.Height;
+
uiGeometry.geometry.width = width;
uiGeometry.geometry.height = height;
uiGeometry.geometry.par.num = settings.PixelAspectX;
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
index bcc7f2714..8cf266d7e 100644
--- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
+++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs
@@ -30,6 +30,17 @@ namespace HandBrake.ApplicationServices.Interop.Model.Preview
/// <param name="task">The task.</param>
public PreviewSettings(EncodeTask task)
{
+ this.Cropping = new Cropping(task.Cropping);
+ this.MaxWidth = task.MaxWidth ?? 0;
+ this.MaxHeight = task.MaxHeight ?? 0;
+ this.KeepDisplayAspect = task.KeepDisplayAspect;
+ this.TitleNumber = task.Title;
+ this.Anamorphic = task.Anamorphic;
+ this.Modulus = task.Modulus;
+ this.Width = task.Width ?? 0;
+ this.Height = task.Height ?? 0;
+ this.PixelAspectX = task.PixelAspectX;
+ this.PixelAspectY = task.PixelAspectY;
}
/// <summary>