WinGui: Fix preview images for "None" when using anamorphic content.

(cherry picked from commit 9541cabae0954244b3a4dab53a99830604d97719)
This commit is contained in:
sr55 2020-03-18 21:12:02 +00:00
parent 723849795f
commit e9675bb9da
No known key found for this signature in database
GPG Key ID: DC68C9CE6FEC775F
3 changed files with 19 additions and 6 deletions

View File

@ -217,9 +217,7 @@ namespace HandBrake.Interop.Interop
{ {
height = settings.Height, height = settings.Height,
width = settings.Width, width = settings.Width,
par = settings.Anamorphic != Anamorphic.Custom && settings.Anamorphic != Anamorphic.Automatic par = new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX }
? new hb_rational_t { den = title.Geometry.PAR.Den, num = title.Geometry.PAR.Num }
: new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX }
} }
}; };

View File

@ -181,6 +181,21 @@ namespace HandBrakeWPF.Helpers
{ {
int settingMode = (int)setting + (job.KeepDisplayAspect ? 0x04 : 0); int settingMode = (int)setting + (job.KeepDisplayAspect ? 0x04 : 0);
hb_rational_t computed_par = new hb_rational_t();
switch (job.AnamorphicMode)
{
case Anamorphic.None:
computed_par = new hb_rational_t { den = 1, num = 1 };
break;
case Anamorphic.Custom:
computed_par = new hb_rational_t { den = job.ParH, num = job.ParW };
break;
default:
computed_par = new hb_rational_t { den = title.ParH, num = title.ParW };
break;
}
hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s
{ {
crop = new[] { job.Crop.Top, job.Crop.Bottom, job.Crop.Left, job.Crop.Right }, crop = new[] { job.Crop.Top, job.Crop.Bottom, job.Crop.Left, job.Crop.Right },
@ -190,7 +205,7 @@ namespace HandBrakeWPF.Helpers
maxHeight = job.MaxHeight, maxHeight = job.MaxHeight,
mode = (int)job.AnamorphicMode, mode = (int)job.AnamorphicMode,
modulus = job.Modulus.HasValue ? job.Modulus.Value : 16, modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,
geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW } } geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = computed_par }
}; };
hb_geometry_s sourceGeometry = new hb_geometry_s hb_geometry_s sourceGeometry = new hb_geometry_s

View File

@ -924,8 +924,8 @@ namespace HandBrakeWPF.ViewModels
Height = this.Height, Height = this.Height,
ItuPar = false, ItuPar = false,
Modulus = this.SelectedModulus, Modulus = this.SelectedModulus,
ParW = this.ParWidth, ParW = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParWidth,
ParH = this.ParHeight, ParH = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParHeight,
MaxWidth = this.MaxWidth, MaxWidth = this.MaxWidth,
MaxHeight = this.MaxHeight, MaxHeight = this.MaxHeight,
KeepDisplayAspect = this.MaintainAspectRatio, KeepDisplayAspect = this.MaintainAspectRatio,