summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-15 23:52:47 +0200
committerwm4 <wm4@nowhere>2013-07-15 23:53:58 +0200
commitf77d243a68e2c1c86687b4ea3a69c81403c0a10c (patch)
tree62faf0ea203394a76cf454d154028a37677153fd
parent853b468023ff7c5e4e6e52fc6743cd1d4395d62f (diff)
downloadmpv-f77d243a68e2c1c86687b4ea3a69c81403c0a10c.tar.bz2
mpv-f77d243a68e2c1c86687b4ea3a69c81403c0a10c.tar.xz
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.
-rw-r--r--core/mp_common.h3
1 files changed, 3 insertions, 0 deletions
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