[MPlayer-users] console controls don't work after resuming from suspend

Test Rat ttsestt at gmail.com
Sat Aug 6 23:25:56 CEST 2011


(trying again after subscribe)

$ uname -vm
FreeBSD 9.0-BETA1 #0 r224657M ... amd64

As I tend to occasionally suspend mplayer to do some other things like
browsing mplayer(1) man page I noticed that previously working
keybinding no longer work after resume. After a bit of playing with
stty(1) and tcsetattr(3) it looks like termios state is lost at least
partially with some shells (tcsh, bash, zsh) and not with others (sh,
dash, csh, pdksh).

Does anyone else have similar issue? Who to report the bug?

%% a quick workaround
Index: mplayer.c
===================================================================
--- mplayer.c	(revision 33953)
+++ mplayer.c	(working copy)
@@ -786,6 +786,10 @@ void exit_player(enum exit_reason how)
     exit_player_with_rc(how, 1);
 }
 
+static void continue_sighandler(int x){
+  getch2_enable();
+}
+
 #ifndef __MINGW32__
 static void child_sighandler(int x)
 {
@@ -3080,8 +3084,10 @@ play_next_file:
     if (!noconsolecontrols && !slave_mode) {
         if (initialized_flags & INITIALIZED_GETCH2)
             mp_msg(MSGT_CPLAYER, MSGL_WARN, MSGTR_Getch2InitializedTwice);
-        else
+        else {
             getch2_enable();  // prepare stdin for hotkeys...
+            signal(SIGCONT,continue_sighandler);
+	}
         initialized_flags |= INITIALIZED_GETCH2;
         mp_msg(MSGT_CPLAYER, MSGL_DBG2, "\n[[[init getch2]]]\n");
     }
%%


More information about the MPlayer-users mailing list