From f77d243a68e2c1c86687b4ea3a69c81403c0a10c Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Jul 2013 23:52:47 +0200 Subject: mp_common: add MPMAX/MPMIN macros From now on, usage of these macros is encouraged over using FFMAX and FFMIN. FFMAX and FFMIN are perfectly fine, and the added macros are actually exactly the same as the FFMAX and FFMIN definitions. But they require including libavutil headers, and certain differences between Libav and FFmpeg very often introduced breakages if these macros were somehow not defined because a header was not recursively included. Defining this macro on our own is the best way to escape from this annoying issue. --- core/mp_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/mp_common.h b/core/mp_common.h index 6cb1da373d..bc6d4f3d32 100644 --- a/core/mp_common.h +++ b/core/mp_common.h @@ -34,6 +34,9 @@ #define ROUND(x) ((int)((x) < 0 ? (x) - 0.5 : (x) + 0.5)) +#define MPMAX(a, b) ((a) > (b) ? (a) : (b)) +#define MPMIN(a, b) ((a) > (b) ? (b) : (a)) + #define CONTROL_OK 1 #define CONTROL_TRUE 1 #define CONTROL_FALSE 0 -- cgit v1.2.3