From 1262abf0b658545d7e565eeea8db7914f75994c0 Mon Sep 17 00:00:00 2001 From: jstebbins Date: Mon, 31 Oct 2011 15:16:47 +0000 Subject: [PATCH] LinGui: fix a problem with height control Attempting to increase the height would revert back to previous setting due to rounding problems. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4333 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- gtk/src/hb-backend.c | 3 +++ gtk/src/preview.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index d3f85a9c8..4b765da29 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3933,7 +3933,10 @@ ghb_set_scale_settings(GValue *settings, gint mode) job->anamorphic.dar_height = 0; if (keep_height && pic_par == 2) + { width = ((double)height * crop_width / crop_height); + width = MOD_ROUND(width, mod); + } job->width = width; job->height = height; job->maxWidth = max_width; diff --git a/gtk/src/preview.h b/gtk/src/preview.h index f89e4f335..089d60d1c 100644 --- a/gtk/src/preview.h +++ b/gtk/src/preview.h @@ -16,7 +16,7 @@ #if !defined(_GHB_PREVIEW_H_) #define _GHB_PREVIEW_H_ -#define MOD_ROUND(v,m) ((m==1)?v:(m * ((v + (m>>1) - 1) / m))) +#define MOD_ROUND(v,m) ((m==1)?v:(m * ((v + (m>>1)) / m))) #define MOD_DOWN(v,m) (m * (v / m)) #define MOD_UP(v,m) (m * ((v + m - 1) / m)) -- 2.40.0