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

Reimar =?UTF8?Q?D=F6ffinger?= Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Jun 21 12:27:01 CEST 2005


Hi,
On Wed, May 04, 2005 at 06:52:46PM +0400, Lev A. Melnikovsky wrote:
> 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.

Of course here the question is why you specify repeat 32?
I really prefer to be convinced that a patch provides a useful
feature...

> +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;
> +}
> +

Why did you move that if(cmd_buf) thing up, shouldn't just adding the
while(1) loop be enough?
Also if there are two events followed very closely by each other, won't
the first one be simply ignored by your patch?

Greetings,
Reimar D?ffinger




More information about the MPlayer-dev-eng mailing list