summaryrefslogtreecommitdiffstats
path: root/osdep/terminal-win.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-01 22:57:56 +0200
committerwm4 <wm4@nowhere>2014-08-01 22:57:56 +0200
commitbf5b1e9a0517b357b93ffaef7b6d96ad8b9917b0 (patch)
treec689fb6dc891f72b44eb7895dc57f9c376add0ed /osdep/terminal-win.c
parent6aac17cebbcec645a9c07043b78d57a9b04f2578 (diff)
downloadmpv-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/terminal-win.c')
-rw-r--r--osdep/terminal-win.c25
1 files changed, 1 insertions, 24 deletions
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)