[MPlayer-dev-eng] [PATCH] lirc repeat patch

Lev A. Melnikovsky leva at despammed.com
Wed May 4 16:52:46 CEST 2005


Hi!

Modern lirc (0.7.0) sends multiple empty events when "repeat" is specified 
in the config file. For instance, the line "repeat 32" (my remote sends 32 
events for each Volume_Up press) will lead to 31 empty events and 1 
sensible one. The patch makes mplayer swallow all available events at 
once, not one at a time - this greatly improves responsiveness.

-L.
-------------- next part --------------
--- MPlayer-1.0pre7/input/lirc.c.lirc	2002-10-24 02:23:12.000000000 +0400
+++ MPlayer-1.0pre7/input/lirc.c	2005-04-29 17:51:53.000000000 +0400
@@ -65,13 +65,16 @@
   FD_ZERO(&fds);
   FD_SET(fd,&fds);
   memset(&tv,0,sizeof(tv));
+while(1) {
   while((r = select(fd+1,&fds,NULL,NULL,&tv)) <= 0) {
     if(r < 0) {
       if(errno == EINTR)
 	continue;
       mp_msg(MSGT_INPUT,MSGL_ERR,"Select error : %s\n",strerror(errno));
       return MP_INPUT_ERROR;
-    } else
+    } else  if(cmd_buf) // return the first command in the buffer
+		return mp_input_lirc_read(fd,dest,s);
+	    else
       return MP_INPUT_NOTHING;
   }
   
@@ -99,10 +102,8 @@
 
   if(r < 0)
     return MP_INPUT_DEAD;
-  else if(cmd_buf) // return the first command in the buffer
-    return mp_input_lirc_read(fd,dest,s);
-  else
-    return MP_INPUT_NOTHING;
+}
+
 
 }
 


More information about the MPlayer-dev-eng mailing list