summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-26 20:31:26 +0200
committerwm4 <wm4@nowhere>2014-07-26 20:31:26 +0200
commit760548da286400534017e885af123fffeb6cc707 (patch)
tree0fbfcc64d8b23b84e7d0221be0cbe0390e07d650 /video
parent3f268cc4f2a498f909f9199b1683d2c6eb285af8 (diff)
downloadmpv-760548da286400534017e885af123fffeb6cc707.tar.bz2
mpv-760548da286400534017e885af123fffeb6cc707.tar.xz
vo: hack to avoid threading issues with mouse input
VO backends which are or will run in their own thread have a problem with vo_mouse_movement() calling vo_control(). Restrict this to VOs which actually need this.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo.c3
-rw-r--r--video/out/vo.h2
-rw-r--r--video/out/vo_wayland.c1
-rw-r--r--video/out/vo_x11.c1
-rw-r--r--video/out/vo_xv.c1
5 files changed, 7 insertions, 1 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index cbf06a98df..f7dafa2735 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -416,7 +416,8 @@ void vo_mouse_movement(struct vo *vo, int posx, int posy)
if (!vo->opts->enable_mouse_movements)
return;
float p[2] = {posx, posy};
- vo_control(vo, VOCTRL_WINDOW_TO_OSD_COORDS, p);
+ if (vo->driver->caps & VO_CAP_EVIL_OSD)
+ vo_control(vo, VOCTRL_WINDOW_TO_OSD_COORDS, p);
mp_input_set_mouse_pos(vo->input_ctx, p[0], p[1]);
}
diff --git a/video/out/vo.h b/video/out/vo.h
index c07c071d44..2dade4c9d1 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -134,6 +134,8 @@ struct voctrl_screenshot_args {
// VO does handle mp_image_params.rotate in 90 degree steps
#define VO_CAP_ROTATE90 1
+// Requires VOCTRL_WINDOW_TO_OSD_COORDS to map mouse coords. to OSD coords.
+#define VO_CAP_EVIL_OSD 2
#define VO_MAX_QUEUE 5
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index be9966e434..e0cf143fa0 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -928,6 +928,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
const struct vo_driver video_out_wayland = {
.description = "Wayland SHM video output",
.name = "wayland",
+ .caps = VO_CAP_EVIL_OSD,
.priv_size = sizeof(struct priv),
.preinit = preinit,
.query_format = query_format,
diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c
index 63c256c509..6cd2220c2b 100644
--- a/video/out/vo_x11.c
+++ b/video/out/vo_x11.c
@@ -647,6 +647,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
const struct vo_driver video_out_x11 = {
.description = "X11 ( XImage/Shm )",
.name = "x11",
+ .caps = VO_CAP_EVIL_OSD,
.priv_size = sizeof(struct priv),
.options = (const struct m_option []){{0}},
.preinit = preinit,
diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c
index f2932e89b1..e8f0fcd490 100644
--- a/video/out/vo_xv.c
+++ b/video/out/vo_xv.c
@@ -866,6 +866,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
const struct vo_driver video_out_xv = {
.description = "X11/Xv",
.name = "xv",
+ .caps = VO_CAP_EVIL_OSD,
.preinit = preinit,
.query_format = query_format,
.reconfig = reconfig,