summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2020-03-18 21:12:02 +0000
committersr55 <[email protected]>2020-03-18 21:12:11 +0000
commit9541cabae0954244b3a4dab53a99830604d97719 (patch)
tree940427d3eb54de52a566ba75996096fdd0eb54b8 /win/CS/HandBrakeWPF
parent6b89f8207db86d487203d293cec0442ad02e5b1e (diff)
WinGui: Fix preview images for "None" when using anamorphic content.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/PictureSize.cs17
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs4
2 files changed, 18 insertions, 3 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
index 553978e50..b34498348 100644
--- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
+++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs
@@ -181,6 +181,21 @@ namespace HandBrakeWPF.Helpers
{
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
{
crop = new[] { job.Crop.Top, job.Crop.Bottom, job.Crop.Left, job.Crop.Right },
@@ -190,7 +205,7 @@ namespace HandBrakeWPF.Helpers
maxHeight = job.MaxHeight,
mode = (int)job.AnamorphicMode,
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
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 3ee12fa6d..c8b85d7e6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -924,8 +924,8 @@ namespace HandBrakeWPF.ViewModels
Height = this.Height,
ItuPar = false,
Modulus = this.SelectedModulus,
- ParW = this.ParWidth,
- ParH = this.ParHeight,
+ ParW = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParWidth,
+ ParH = this.SelectedAnamorphicMode == Anamorphic.None ? 1 : this.ParHeight,
MaxWidth = this.MaxWidth,
MaxHeight = this.MaxHeight,
KeepDisplayAspect = this.MaintainAspectRatio,