[MPlayer-dev-eng] [PATCH] another -vo svga kbd echo fix

Dimitar Zhekov jimmy at is-vn.bg
Wed May 8 10:09:20 CEST 2002


 This is a fix for the keys not being echoed to the terminal after
 exiting mplayer -vo svga. The bug has been first reported in April
 2002 under the topic "A couple of SVGAlib-related bugs in v0.90", and
 is still unfixed. I see that Matan Ziv-Av has posted a patch for it in
 April, "[PATCH] svgalib termios behavior", but it is not applied. The
 patch below is simpler, it inserts one line in vo_svga.c only.

 The problem, if I get it right, is that the following chain of events
 takes place:

 1) getch2_enable() is invoked. It saves the terminal state and then
 clears CANON and ECHO.
 2) svgalib is initialized. It saves the terminal state, with CANON and
 ECHO cleared, and marks it to be restored atexit().
 3) getch2_disable() is invoked. It restores the terminal state saved
 by getch2_enable().
 4) at exit, the terminal state saved on svgalib init is restored,
 including CANON and ECHO cleared.

 Now this can probably be fixed by moving getch2_enable after vo_init,
 but it is clearer (IMHO) not to have two propably conflicting terminal
 state saves/restores, so I placed a getch2_disable() in vo_svga.c just
 before vga_init(). This fixes the bug, and after svgalib init, the
 terminal is in a state suitable for mplayer input (.c_cc[VMIN]=1 etc.)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-svga-echo.diff
Type: application/octet-stream
Size: 450 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20020508/aceb6ca6/attachment.obj>


More information about the MPlayer-dev-eng mailing list