From 019bae008cce2457ddb43a5fbc914e8a9214a2b3 Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 30 May 2003 18:23:55 +0000 Subject: lirccd support by Fredrik Tolf git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10216 b3059339-0415-0410-9bf9-f77b7e298cf2 --- input/input.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index 059205a461..2eec96d356 100644 --- a/input/input.c +++ b/input/input.c @@ -33,6 +33,10 @@ #include "lirc.h" #endif +#ifdef HAVE_LIRCC +#include +#endif + /// This array defines all know commands. /// The first field is an id used to recognize the command without too many strcmp /// The second is abviously the command name @@ -381,7 +385,7 @@ static short ar_state = -1; static mp_cmd_t* ar_cmd = NULL; static unsigned int ar_delay = 100, ar_rate = 8, last_ar = 0; -static int use_joystick = 1, use_lirc = 1; +static int use_joystick = 1, use_lirc = 1, use_lircc = 1; static char* config_file = "input.conf"; static char* js_dev = NULL; @@ -410,6 +414,8 @@ static config_t mp_input_opts[] = { { "joystick", &use_joystick, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, { "nolirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, { "lirc", &use_lirc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, + { "nolircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL }, + { "lircc", &use_lircc, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL }, { NULL, NULL, 0, 0, 0, 0, NULL} }; @@ -1481,6 +1487,14 @@ mp_input_init(void) { } #endif +#ifdef HAVE_LIRCC + if(use_lircc) { + int fd = lircc_init("mplayer", NULL); + if(fd >= 0) + mp_input_add_cmd_fd(fd,1,NULL,(mp_close_func_t)lircc_cleanup); + } +#endif + if(in_file) { struct stat st; if(stat(in_file,&st)) -- cgit v1.2.3