Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Truth about vdr 1.1.20 and console plugin since version 5.0



Hi,

since vdr 1.1.20 there exist real support for the
keyboard, so vdr itself and the loaded plugins can
use the keyboard together. And the console plugin
since version 5.0 uses this keyboard support.

Advantage: The special compiler switches
(REMOTE=NONE respectively NO_KBD=1 since vdr 1.1.18)
and the -r switch of the console plugin are no
longer needed to use console plugin with vdr :-)

But: vdr 1.1.20 and 1.1.21 have an fault that
appears when vdr is running in the background...

The problems to solve are:

1) If vdr is running without access to a keyboard
   (means no stdin), e.g. if it runs in backgorund,
   it would block and no other operations were be
   possible.
   Besides: vdr must not call the function to learn
   the keyboard keys for controlling vdr.

2) So Klaus has inserted an check that disables
   keyboard support in vdr, if vdr is not the
   process that owns the stdin.

3) If you start vdr in background and redirect the
   stdin/stdout to an special tty like with the -t
   switch, it disables the keyboard support anyway.
   !! this is the problem !!


So Klaus, i think vdr should enable the keyboad, if
someone starts it with the -t switch.

The following patch should solve the problem:

---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--

diff -u -N vdr-1.1.20/vdr.c vdr-1.1.20_Keyboard/vdr.c
--- vdr-1.1.20/vdr.c	Fri Dec 13 17:01:09 2002
+++ vdr-1.1.20_Keyboard/vdr.c	Thu Jan 16 19:28:56 2003
@@ -78,10 +78,6 @@
 
 int main(int argc, char *argv[])
 {
-  // Save terminal settings:
-
-  struct termios savedTm;
-  bool HasStdin = tcgetpgrp(STDIN_FILENO) == getpid() &&
tcgetattr(STDIN_FILENO, &savedTm) == 0;
 
   // Initiate locale:
 
@@ -324,6 +320,13 @@
      stderr = freopen(Terminal, "w", stderr);
      }
 
+
+  // Save terminal settings:
+
+  struct termios savedTm;
+  bool HasStdin = (Terminal || tcgetpgrp(STDIN_FILENO) == getpid()) &&
tcgetattr(STDIN_FILENO, &savedTm) == 0;
+
+
   isyslog("VDR version %s started", VDRVERSION);
 
   // Load plugins:

---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--


Please note: This is only a work around. The real solution
would be to determine if vdr has full access to the stdin!

Hope that helps

Jan




-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index