summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 12:55:23 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-29 12:55:23 +0300
commit986e519fc9373e2b3dab6f86debcbd7e13466c34 (patch)
tree928eb75d2e6e5685fa468efe4e074a6825a197b9 /libvo
parentb6b82964aa3f9ba93f6f284ed97c278743f50fce (diff)
downloadmpv-986e519fc9373e2b3dab6f86debcbd7e13466c34.tar.bz2
mpv-986e519fc9373e2b3dab6f86debcbd7e13466c34.tar.xz
input: Remove separate mp_input_add_event_fd
Use the same mp_input_add_key_fd for all uses and add a context argument to its callback that was before only in the event fd callbacks. Instead of checking in input.c whether keys were inserted to the keypress FIFO during the callback do the check in the callback before returning and set return value accordingly.
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_xv.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 041ae6a275..885bd0f7f1 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -44,6 +44,7 @@ Buffer allocation:
#include "subopt-helper.h"
#include "input/input.h"
+#include "mp_fifo.h"
#ifdef HAVE_NEW_GUI
#include "gui/interface.h"
@@ -710,14 +711,15 @@ static void uninit(struct vo *vo)
vo_vm_close(vo);
#endif
if (ctx->event_fd_registered)
- mp_input_rm_event_fd(ConnectionNumber(vo->x11->display));
+ mp_input_rm_key_fd(ConnectionNumber(vo->x11->display));
// uninit() shouldn't get called unless initialization went past vo_init()
vo_x11_uninit(vo);
}
-static void x11_fd_callback(void *ctx)
+static int x11_fd_callback(void *ctx, int fd)
{
- return check_events(ctx);
+ check_events(ctx);
+ return mplayer_get_key(NULL, 0);
}
static int preinit(struct vo *vo, const char *arg)
@@ -841,7 +843,8 @@ static int preinit(struct vo *vo, const char *arg)
ctx->fo = XvListImageFormats(x11->display, x11->xv_port, (int *) &ctx->formats);
- mp_input_add_event_fd(ConnectionNumber(x11->display), x11_fd_callback, vo);
+ mp_input_add_key_fd(ConnectionNumber(x11->display), 1, x11_fd_callback,
+ NULL, vo);
ctx->event_fd_registered = 1;
return 0;