diff options
author | jstebbins <[email protected]> | 2011-10-31 15:16:47 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2011-10-31 15:16:47 +0000 |
commit | 1262abf0b658545d7e565eeea8db7914f75994c0 (patch) | |
tree | 331c196bf92da29bad0614f386feb9966c365675 | |
parent | 2eae9be4713838c9eb4a111246f2e8d63a62fd7a (diff) |
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
-rw-r--r-- | gtk/src/hb-backend.c | 3 | ||||
-rw-r--r-- | gtk/src/preview.h | 2 |
2 files changed, 4 insertions, 1 deletions
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)) |