summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-25 22:44:12 +0200
committerwm4 <wm4@nowhere>2013-09-25 22:44:12 +0200
commitb0cc3c2cf4e342e33300adaea4a98565ad866e22 (patch)
tree0a6824a49b684461205ecd2881b80a3d42b1bded /mpvcore
parent200fb7eceb5430c0433e09b815fd13a93ded2a8a (diff)
downloadmpv-b0cc3c2cf4e342e33300adaea4a98565ad866e22.tar.bz2
mpv-b0cc3c2cf4e342e33300adaea4a98565ad866e22.tar.xz
Fix previous commit
This time it broke because I didn't actually test compiling vo_vaapi.c, and it was using a macro from mp_image.h, which implicitly assumed FFALIGN was available. Screw that too, and copy the definition of ffmpeg's FFALIGN to MP_ALIGN_UP, and move these macros to mp_comnon.h.
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/mp_common.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/mpvcore/mp_common.h b/mpvcore/mp_common.h
index ee2f055807..543c22073e 100644
--- a/mpvcore/mp_common.h
+++ b/mpvcore/mp_common.h
@@ -40,6 +40,10 @@
do { type SWAP_tmp = b; b = a; a = SWAP_tmp; } while (0)
#define MP_ARRAY_SIZE(s) (sizeof(s) / sizeof((s)[0]))
+// align must be a power of two (align >= 1), x >= 0
+#define MP_ALIGN_UP(x, align) (((x) + (align) - 1) & ~((align) - 1))
+#define MP_ALIGN_DOWN(x, align) ((x) & ~((align) - 1))
+
#define CONTROL_OK 1
#define CONTROL_TRUE 1
#define CONTROL_FALSE 0