summaryrefslogtreecommitdiffstats
path: root/libhb/common.h
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-08-27 15:58:29 +0000
committerjstebbins <[email protected]>2014-08-27 15:58:29 +0000
commitcd1b955b6d297fb4003b0bc02d39586a689ffaf7 (patch)
treeb5d6ec7356eeaf00f8a304ea1a73347b252f70e6 /libhb/common.h
parent15417070c594a330923a62f0ab2054c39d3115f4 (diff)
CLI: fix dimensions problem when both width and height are specified
The GUI will precompute both width and height and specify both on the command line. But then the CLI recomputes width based on height which can result in the width being changed. So, in non-anamorphic mode, disable keep_aspect so that width and heigh are both kept. And in other anamorphic modes, use custom ana when computing dimensions so that both width and height are kept (i.e. recompute par). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6369 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r--libhb/common.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/libhb/common.h b/libhb/common.h
index 2882bdf37..ef10fff41 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -63,11 +63,10 @@
#define HB_DEBUG_ASSERT(x, y) { if ((x)) { hb_error("ASSERT: %s", y); exit(1); } }
#endif
-#define EVEN( a ) ( (a) + ( (a) & 1 ) )
-#define MULTIPLE_16( a ) ( 16 * ( ( (a) + 8 ) / 16 ) )
-#define MULTIPLE_MOD( a, b ) ((b==1)?a:( b * ( ( (a) + (b / 2) - 1) / b ) ))
-#define MULTIPLE_MOD_UP( a, b ) ((b==1)?a:( b * ( ( (a) + (b) - 1) / b ) ))
-#define MULTIPLE_MOD_DOWN( a, b ) ((b==1)?a:( b * ( (a) / b ) ))
+#define EVEN( a ) ((a) + ((a) & 1))
+#define MULTIPLE_MOD(a, b) (((b) * (int)(((a) + ((b) / 2)) / (b))))
+#define MULTIPLE_MOD_UP(a, b) (((b) * (int)(((a) + ((b) - 1)) / (b))))
+#define MULTIPLE_MOD_DOWN(a, b) (((b) * (int)((a) / (b))))
#define HB_DVD_READ_BUFFER_SIZE 2048