]> granicus.if.org Git - handbrake/commitdiff
LinGui: work around conflicting PicturePAR and UsesPictureSettings
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 24 Oct 2016 17:47:01 +0000 (10:47 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 24 Oct 2016 17:47:01 +0000 (10:47 -0700)
UsesPictureSettings takes precedence

gtk/src/presets.c

index e6813e9a6aad8d8296a85621d635977edb474a76..76e09855e73eb580589d5191f00fe4c5537ce8c6 100644 (file)
@@ -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