summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xine_frontend_lirc.c46
-rw-r--r--xine_frontend_main.c9
2 files changed, 32 insertions, 23 deletions
diff --git a/xine_frontend_lirc.c b/xine_frontend_lirc.c
index 12820b07..da91ea69 100644
--- a/xine_frontend_lirc.c
+++ b/xine_frontend_lirc.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_lirc.c,v 1.19 2008-11-16 15:02:45 rofafor Exp $
+ * $Id: xine_frontend_lirc.c,v 1.20 2008-11-17 23:27:23 phintuka Exp $
*
*/
/*
@@ -54,6 +54,8 @@ static volatile char *lirc_device_name = NULL;
static volatile int fd_lirc = -1;
static int lirc_repeat_emu = 0;
+/* xine_frontend_main.c: */
+extern int gui_hotkeys;
static uint64_t time_ms()
{
@@ -124,6 +126,7 @@ static void *lirc_receiver_thread(void *fe_gen)
FD_ZERO(&set);
FD_SET(fd_lirc, &set);
+ pthread_testcancel();
if (timeout >= 0) {
struct timeval tv;
tv.tv_sec = timeout / 1000;
@@ -133,6 +136,7 @@ static void *lirc_receiver_thread(void *fe_gen)
ready = select(FD_SETSIZE, &set, NULL, NULL, NULL) > 0 && FD_ISSET(fd_lirc, &set);
}
+ pthread_testcancel();
if(ready < 0) {
LOGMSG("LIRC connection lost ?");
break;
@@ -143,6 +147,7 @@ static void *lirc_receiver_thread(void *fe_gen)
do {
errno = 0;
ret = read(fd_lirc, buf, sizeof(buf));
+ pthread_testcancel();
} while(ret < 0 && errno == EINTR);
if (ret <= 0 ) {
@@ -150,6 +155,7 @@ static void *lirc_receiver_thread(void *fe_gen)
LOGERR("LIRC connection lost");
lircd_connect();
while(lirc_device_name && fd_lirc < 0) {
+ pthread_testcancel();
sleep(RECONNECTDELAY/1000);
lircd_connect();
}
@@ -201,26 +207,26 @@ static void *lirc_receiver_thread(void *fe_gen)
}
LastTime = time_ms();
-#if defined(XINELIBOUTPUT_FE_TOGGLE_FULLSCREEN) || defined(INTERPRET_LIRC_KEYS)
- if(!strcmp(KeyName, "Quit")) {
- fe->send_event(fe, "QUIT");
- break;
-
- } else if(!strcmp(KeyName, "Fullscreen")) {
- if(!repeat)
- fe->send_event(fe, "TOGGLE_FULLSCREEN");
-
- } else if(!strcmp(KeyName, "Deinterlace")) {
- if(!repeat)
- fe->send_event(fe, "TOGGLE_DEINTERLACE");
-
- } else
-#endif
- {
- alarm(3);
- fe->send_input_event(fe, "LIRC", KeyName, repeat, 0);
- alarm(0);
+ if (gui_hotkeys) {
+ if(!strcmp(KeyName, "Quit")) {
+ fe->send_event(fe, "QUIT");
+ break;
+ }
+ if(!strcmp(KeyName, "Fullscreen")) {
+ if(!repeat)
+ fe->send_event(fe, "TOGGLE_FULLSCREEN");
+ continue;
}
+ if(!strcmp(KeyName, "Deinterlace")) {
+ if(!repeat)
+ fe->send_event(fe, "TOGGLE_DEINTERLACE");
+ continue;
+ }
+ }
+
+ alarm(3);
+ fe->send_input_event(fe, "LIRC", KeyName, repeat, 0);
+ alarm(0);
}
else if (repeat) { /* the last one was a repeat, so let's generate a release */
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index d5380633..e45feed6 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_main.c,v 1.67 2008-11-17 23:01:48 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.68 2008-11-17 23:27:23 phintuka Exp $
*
*/
@@ -576,8 +576,11 @@ int main(int argc, char *argv[])
break;
case 'o': gui_hotkeys = 1;
PRINTF("GUI hotkeys enabled\n"
- " mapping f,F -> fullscreen toggle\n"
- " d,D -> deinterlace toggle\n");
+ " mapping keyboard f,F -> fullscreen toggle\n"
+ " keyboard d,D -> deinterlace toggle\n"
+ " LIRC Deinterlace -> deinterlace toggle\n"
+ " LIRC Fullscreen -> fullscreen toggle\n"
+ " LIRC Quit -> exit\n");
break;
case 'b': nokbd = daemon_mode = 1;
PRINTF("Keyboard input disabled\n");