summaryrefslogtreecommitdiffstats
path: root/video/out/vo_xv.c
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-16 13:28:28 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-11-03 21:59:54 +0100
commit37388ebb0ef9085c841d7f94e665a5a77cfe0e92 (patch)
treeb47d18bee4e7f661d9e6d794dac0ec1cebcd3a37 /video/out/vo_xv.c
parent891a2a1f474add323145e6b2cd2d29181830e4a4 (diff)
downloadmpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.bz2
mpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.xz
configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
Diffstat (limited to 'video/out/vo_xv.c')
-rw-r--r--video/out/vo_xv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index 28e3fdfcbe..02daaf86f8 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -33,7 +33,7 @@
#include "config.h"
-#ifdef HAVE_SHM
+#if HAVE_SHM
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
@@ -91,7 +91,7 @@ struct xvctx {
struct mp_rect dst_rect;
uint32_t max_width, max_height; // zero means: not set
int Shmem_Flag;
-#ifdef HAVE_SHM
+#if HAVE_SHM
XShmSegmentInfo Shminfo[2];
int Shm_Warned_Slow;
#endif
@@ -490,7 +490,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
struct vo_x11_state *x11 = vo->x11;
// align it for faster OSD rendering (draw_bmp.c swscale usage)
int aligned_w = FFALIGN(ctx->image_width, 32);
-#ifdef HAVE_SHM
+#if HAVE_SHM
if (x11->display_is_local && XShmQueryExtension(x11->display)) {
ctx->Shmem_Flag = 1;
x11->ShmCompletionEvent = XShmGetEventBase(x11->display)
@@ -544,7 +544,7 @@ static bool allocate_xvimage(struct vo *vo, int foo)
static void deallocate_xvimage(struct vo *vo, int foo)
{
struct xvctx *ctx = vo->priv;
-#ifdef HAVE_SHM
+#if HAVE_SHM
if (ctx->Shmem_Flag) {
XShmDetach(vo->x11->display, &ctx->Shminfo[foo]);
shmdt(ctx->Shminfo[foo].shmaddr);
@@ -573,7 +573,7 @@ static inline void put_xvimage(struct vo *vo, XvImage *xvi)
struct mp_rect *dst = &ctx->dst_rect;
int dw = dst->x1 - dst->x0, dh = dst->y1 - dst->y0;
int sw = src->x1 - src->x0, sh = src->y1 - src->y0;
-#ifdef HAVE_SHM
+#if HAVE_SHM
if (ctx->Shmem_Flag) {
XvShmPutImage(x11->display, ctx->xv_port, x11->window, x11->vo_gc, xvi,
src->x0, src->y0, sw, sh,
@@ -628,7 +628,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd)
static void wait_for_completion(struct vo *vo, int max_outstanding)
{
-#ifdef HAVE_SHM
+#if HAVE_SHM
struct xvctx *ctx = vo->priv;
struct vo_x11_state *x11 = vo->x11;
if (ctx->Shmem_Flag) {