Skip to content

Commit

Permalink
LinGui: fix a problem with height control
Browse files Browse the repository at this point in the history
Attempting to increase the height would revert back to previous setting
due to rounding problems.

git-svn-id: svn://localhost/HandBrake/trunk@4333 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
jstebbins committed Oct 31, 2011
1 parent 62287a3 commit 1235302
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions gtk/src/hb-backend.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion gtk/src/preview.h
Expand Up @@ -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))

Expand Down

0 comments on commit 1235302

Please sign in to comment.