summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2016-10-24 10:47:01 -0700
committerJohn Stebbins <[email protected]>2016-10-24 10:47:01 -0700
commitc751a3bb06fc9a68d9ccccbb35ecfe2ab1a3cb63 (patch)
tree52daba02ca0b798feabcc83c92f5cd9ef0ef462b /gtk
parent5ab593ca1197d5cfd2255ad846db61cf65ad631d (diff)
LinGui: work around conflicting PicturePAR and UsesPictureSettings
UsesPictureSettings takes precedence
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/presets.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index e6813e9a6..76e09855e 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -285,24 +285,31 @@ ghb_preset_to_settings(GhbValue *settings, GhbValue *preset)
// Fix up all the internal settings that are derived from preset values.
- int width, height;
- width = ghb_dict_get_int(settings, "PictureWidth");
- height = ghb_dict_get_int(settings, "PictureHeight");
-
ghb_dict_set(settings, "scale_height", ghb_value_dup(
ghb_dict_get_value(settings, "PictureHeight")));
ghb_dict_set(settings, "scale_width", ghb_value_dup(
ghb_dict_get_value(settings, "PictureWidth")));
- gint uses_pic;
- gint vqtype;
+ int width, height, uses_pic, autoscale;
+ const char * pic_par;
+ width = ghb_dict_get_int(settings, "PictureWidth");
+ height = ghb_dict_get_int(settings, "PictureHeight");
uses_pic = ghb_dict_get_int(settings, "UsesPictureSettings");
- vqtype = ghb_dict_get_int(settings, "VideoQualityType");
+ pic_par = ghb_dict_get_string(settings, "PicturePAR");
+
+ autoscale = uses_pic == 2 || (width == 0 && height == 0);
+ ghb_dict_set_bool(settings, "autoscale", autoscale);
+
+ if (!autoscale && pic_par != NULL && !strcasecmp(pic_par, "strict"))
+ {
+ ghb_dict_set_string(settings, "PicturePAR", "loose");
+ }
- ghb_dict_set_bool(settings, "autoscale",
- uses_pic == 2 || (width == 0 && height == 0));
+ gint vqtype;
+
+ vqtype = ghb_dict_get_int(settings, "VideoQualityType");
// VideoQualityType/0/1/2 - vquality_type_/target/bitrate/constant
// *note: target is no longer used