]> granicus.if.org Git - handbrake/commitdiff
fix a couple picture scale issues
authorjstebbins <jstebbins.hb@gmail.com>
Fri, 23 Oct 2009 00:30:02 +0000 (00:30 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Fri, 23 Oct 2009 00:30:02 +0000 (00:30 +0000)
adjusting the storage height sometimes got wedged due to incorrect rounding
causing feedback loop.
height change leads to width change, but width rounded too small
width change leads to height change that goes back to original height

presets that had width/height saved (e.g. iPod) were blocking user from
manually selecting a higher resolution.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2894 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/hb-backend.c

index 396eae561159868a714d66cce707a9f10c06c68a..6dc26275cf9557f79ac3aafeadf5cca78d730fd2 100644 (file)
@@ -3114,7 +3114,12 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
        if (busy) return;
        busy = TRUE;
 
-       
+       if (!ud->dont_clear_presets && (keep_width || keep_height))
+       {
+               ghb_settings_set_int(ud->settings, "PictureWidth", 0);
+               ghb_settings_set_int(ud->settings, "PictureHeight", 0);
+       }
+
        // First configure widgets
        mod = ghb_settings_combo_int(ud->settings, "PictureModulus");
        pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR");
@@ -3250,7 +3255,7 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
                job->anamorphic.dar_height = 0;
 
                if (keep_height && pic_par == 2)
-                       width = ((double)height * crop_width / crop_height) + 0.5;
+                       width = ((double)height * crop_width / crop_height) + mod / 2;
                job->width = width;
                job->height = height;
                job->maxWidth = max_width;