From a0c1d2ccdd62ef333e30f2fc9717fd0bf44ec4a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 30 May 2010 14:41:04 +0300 Subject: [PATCH] SDL: use key thread (partially fix #3661) --- modules/video_output/Modules.am | 2 +- modules/video_output/sdl.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/video_output/Modules.am b/modules/video_output/Modules.am index b0a5b4b521..92f28feefa 100644 --- a/modules/video_output/Modules.am +++ b/modules/video_output/Modules.am @@ -7,7 +7,7 @@ LIBTOOL=@LIBTOOL@ --tag=CC SOURCES_aa = aa.c SOURCES_caca = caca.c SOURCES_fb = fb.c -SOURCES_vout_sdl = sdl.c +SOURCES_vout_sdl = sdl.c keythread.h keythread.c SOURCES_snapshot = snapshot.c SOURCES_directfb = directfb.c SOURCES_vmem = vmem.c diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c index 17448a0e76..84af7d55df 100644 --- a/modules/video_output/sdl.c +++ b/modules/video_output/sdl.c @@ -35,6 +35,7 @@ #include #include #include +#include "keythread.h" #include @@ -99,6 +100,7 @@ struct vout_display_sys_t { /* */ picture_pool_t *pool; + key_thread_t *keys; }; /** @@ -332,6 +334,8 @@ static int Open(vlc_object_t *object) /* */ vout_display_SendEventDisplaySize(vd, display_width, display_height, vd->cfg->is_fullscreen); + + sys->keys = vlc_CreateKeyThread (vd); return VLC_SUCCESS; error: @@ -358,6 +362,8 @@ static void Close(vlc_object_t *object) vout_display_t *vd = (vout_display_t *)object; vout_display_sys_t *sys = vd->sys; + vlc_DestroyKeyThread(sys->keys); + if (sys->pool) picture_pool_Delete(sys->pool); @@ -596,7 +602,7 @@ static void Manage(vout_display_t *vd) key |= KEY_MODIFIER_CTRL; if (event.key.keysym.mod & KMOD_ALT) key |= KEY_MODIFIER_ALT; - vout_display_SendEventKey(vd, key); + vlc_EmitKey(sys->keys, key); break; } @@ -702,4 +708,3 @@ static int ConvertKey(SDLKey sdl_key) } return 0; } - -- 2.39.5