summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-25 22:22:02 +0200
committerwm4 <wm4@nowhere>2013-09-25 22:22:02 +0200
commit200fb7eceb5430c0433e09b815fd13a93ded2a8a (patch)
tree53e513fd74e9266d559ecd768cd98b1eda19e91f /mpvcore
parent72fbd846db3bf446b3fa00eba4f0197e6214f942 (diff)
downloadmpv-200fb7eceb5430c0433e09b815fd13a93ded2a8a.tar.bz2
mpv-200fb7eceb5430c0433e09b815fd13a93ded2a8a.tar.xz
vaapi: fix compilation with Libav
The code using FFSWAP was moved from vo_vaapi.c to vaapi.c, which didn't include libavutil/common.h anymore, just libavutil/avutil.h. The header avutil.h doesn't include common.h recursively in Libav, so it broke there. Add FFSWAP as MPSWAP in mp_common.h (copy pasted from ffmpeg) to make sure this doesn't happen again. (This kind of stuff happens all too often, so screw libavutil.)
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/mp_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/mpvcore/mp_common.h b/mpvcore/mp_common.h
index 651136d2cb..ee2f055807 100644
--- a/mpvcore/mp_common.h
+++ b/mpvcore/mp_common.h
@@ -36,6 +36,8 @@
#define MPMAX(a, b) ((a) > (b) ? (a) : (b))
#define MPMIN(a, b) ((a) > (b) ? (b) : (a))
+#define MPSWAP(type, a, b) \
+ do { type SWAP_tmp = b; b = a; a = SWAP_tmp; } while (0)
#define MP_ARRAY_SIZE(s) (sizeof(s) / sizeof((s)[0]))
#define CONTROL_OK 1