diff options
author | wm4 <wm4@nowhere> | 2014-08-01 22:57:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-01 22:57:56 +0200 |
commit | bf5b1e9a0517b357b93ffaef7b6d96ad8b9917b0 (patch) | |
tree | c689fb6dc891f72b44eb7895dc57f9c376add0ed /osdep | |
parent | 6aac17cebbcec645a9c07043b78d57a9b04f2578 (diff) | |
download | mpv-bf5b1e9a0517b357b93ffaef7b6d96ad8b9917b0.tar.bz2 mpv-bf5b1e9a0517b357b93ffaef7b6d96ad8b9917b0.tar.xz |
Remove the last remains of slave mode
Almost nothing was left of it.
The only thing this commit actually removes is support for reading
input commands from stdin. But you can emulate this via:
--input-file=/dev/stdin --input-terminal=no
However, this won't work on Windows. Just use a named pipe.
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/terminal-unix.c | 6 | ||||
-rw-r--r-- | osdep/terminal-win.c | 25 | ||||
-rw-r--r-- | osdep/terminal.h | 3 |
3 files changed, 2 insertions, 32 deletions
diff --git a/osdep/terminal-unix.c b/osdep/terminal-unix.c index 844054e1bd..21ed42cb68 100644 --- a/osdep/terminal-unix.c +++ b/osdep/terminal-unix.c @@ -466,6 +466,7 @@ static int read_keys(void *ctx, int fd) void terminal_setup_getch(struct input_ctx *ictx) { mp_input_add_fd(ictx, 0, 1, NULL, read_keys, NULL, ictx); + getch2_enable(); } static volatile int getch2_active = 0; @@ -624,11 +625,6 @@ void terminal_set_foreground_color(FILE *stream, int c) } } -void terminal_setup_stdin_cmd_input(struct input_ctx *ictx) -{ - mp_input_add_fd(ictx, 0, 1, input_default_read_cmd, NULL, NULL, NULL); -} - int terminal_init(void) { use_terminal = isatty(1); diff --git a/osdep/terminal-win.c b/osdep/terminal-win.c index 918a073a17..19603d87d1 100644 --- a/osdep/terminal-win.c +++ b/osdep/terminal-win.c @@ -54,30 +54,6 @@ static const unsigned char ansi2win32[8] = { FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED, }; -static int mp_input_slave_cmd_func(void *ctx, int fd, char *dest, int size) -{ - DWORD retval; - HANDLE in = GetStdHandle(STD_INPUT_HANDLE); - if (PeekNamedPipe(in, NULL, size, &retval, NULL, NULL)) { - if (size > retval) - size = retval; - } else { - if (WaitForSingleObject(in, 0)) - size = 0; - } - if (!size) - return MP_INPUT_NOTHING; - ReadFile(in, dest, size, &retval, NULL); - if (retval) - return retval; - return MP_INPUT_NOTHING; -} - -void terminal_setup_stdin_cmd_input(struct input_ctx *ictx) -{ - mp_input_add_fd(ictx, 0, 0, mp_input_slave_cmd_func, NULL, NULL, NULL); -} - void get_screen_size(void) { CONSOLE_SCREEN_BUFFER_INFO cinfo; @@ -170,6 +146,7 @@ static int read_keys(void *ctx, int fd) void terminal_setup_getch(struct input_ctx *ictx) { mp_input_add_fd(ictx, 0, 1, NULL, read_keys, NULL, ictx); + getch2_enable(); } void getch2_poll(void) diff --git a/osdep/terminal.h b/osdep/terminal.h index 651e31ed71..4495bfb471 100644 --- a/osdep/terminal.h +++ b/osdep/terminal.h @@ -39,9 +39,6 @@ extern char *terminal_cursor_up; /* Global initialization for terminal output. */ int terminal_init(void); -/* Setup ictx to read input commands from stdin (slave mode) */ -void terminal_setup_stdin_cmd_input(struct input_ctx *ictx); - /* Setup ictx to read keys from the terminal */ void terminal_setup_getch(struct input_ctx *ictx); |