learning keys for LIRC fails on --no-kbd

Message ID 44648F64.9020503@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger May 12, 2006, 1:36 p.m. UTC
  André Weidemann wrote:
> Hi all,
> I am using vdr 1.4.0. I compiled it with REMOTE=LIRC.
> I only need LIRC to control VDR so I started it with the following command:
> 
> ./vdr -u vdr --no-kbd
> 
> After that VDR starts, but does not ask me to press a key on the remote 
> for LIRC.
> Is there a way to only "teach" VDR the keys for LIRC or do I always have 
> to start with the keyboard?

This might be the same problem as reported by Helmut Auer in a PM.
Please try the attached fix.

Klaus
  

Comments

André Weidemann May 14, 2006, 10:52 a.m. UTC | #1
Klaus Schmidinger wrote:
> This might be the same problem as reported by Helmut Auer in a PM.
> Please try the attached fix.
> 
> Klaus

I have tested the patch and it works.

Thank you.
  André
  
Matthias Schwarzott May 14, 2006, 3:31 p.m. UTC | #2
On Friday 12 May 2006 15:36, Klaus Schmidinger wrote:
> André Weidemann wrote:
> > Hi all,
> > I am using vdr 1.4.0. I compiled it with REMOTE=LIRC.
> > I only need LIRC to control VDR so I started it with the following
> > command:
> >
> > ./vdr -u vdr --no-kbd
> >
> > After that VDR starts, but does not ask me to press a key on the remote
> > for LIRC.
> > Is there a way to only "teach" VDR the keys for LIRC or do I always have
> > to start with the keyboard?
>
> This might be the same problem as reported by Helmut Auer in a PM.
> Please try the attached fix.
>
Works good. Will be included in next vdr-1.4.0 ebuild for Gentoo.

Matthias
  

Patch

--- remote.c	2006/04/17 08:58:28	1.50
+++ remote.c	2006/05/12 12:40:15	1.51
@@ -182,11 +182,11 @@ 
             repeatTimeout.Set(REPEATTIMEOUT);
          return k;
          }
-      else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs) && repeatTimeout.TimedOut()) {
-         if (learning && UnknownCode) {
-            *UnknownCode = unknownCode;
-            unknownCode = NULL;
-            }
+      else if (!WaitMs || !keyPressed.TimedWait(mutex, WaitMs) && repeatTimeout.TimedOut())
+         return kNone;
+      else if (learning && UnknownCode && unknownCode) {
+         *UnknownCode = unknownCode;
+         unknownCode = NULL;
          return kNone;
          }
       }