1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-27 19:01:07 +00:00
mpv/input
wm4 740f0f61d8 input: redo how --input-file is handled
Abandon the "old" infrastructure for --input-file (mp_input_add_fd(),
select() loop, non-blocking reads). Replace it with something that
starts a reader thread, using blocking input.

This is for the sake of Windows. Windows is a truly insane operating
system, and there's not even a way to read a pipe in a non-blocking
way, or to wait for new input in an interruptible way (like with
poll()). And unfortunately, some want to use pipe to send input to
mpv. There are probably (slightly) better IPC mechanisms available
on Windows, but for the sake of platform uniformity, make this work
again for now.

On Vista+, CancelIoEx() could probably be used. But there's no way on
XP. Also, that function doesn't work on wine, making development
harder. We could forcibly terminate the thread, which might work, but
is unsafe. So what we do is starting a thread, and if we don't want
the pipe input anymore, we just abandon the thread. The thread might
remain blocked forever, but if we exit the process, the kernel will
forcibly kill it. On Unix, just use poll() to handle this.

Unfortunately the code is pretty crappy, but it's ok, because it's late
and I wanted to stop working on this an hour ago.

Tested on wine; might not work on a real Windows.
2014-08-25 01:00:21 +02:00
..
cmd_list.c command: add append-play loadfile mode 2014-07-23 00:20:53 +02:00
cmd_list.h command: redo ancient TV/DVB/PVR commands 2014-06-11 00:34:41 +02:00
cmd_parse.c input: fix off by one error in command parser 2014-08-07 18:21:36 +02:00
cmd_parse.h input: split off some code from input.c to separate files 2013-12-26 17:13:25 +01:00
event.c input: change mp_input_run_cmd signature 2014-01-04 19:42:16 +01:00
event.h video/out: remove some code duplication between X11 and wayland 2014-01-04 19:33:40 +01:00
input.c input: redo how --input-file is handled 2014-08-25 01:00:21 +02:00
input.h input: redo how --input-file is handled 2014-08-25 01:00:21 +02:00
joystick.c Kill all tabs 2014-04-13 18:03:01 +02:00
joystick.h
keycodes.c build: include <strings.h> for strcasecmp() 2014-07-10 08:29:32 +02:00
keycodes.h input: be stricter about rejecting mouse input with --no-input-cursor 2014-07-27 22:00:55 +02:00
lirc.c input: enable wakeup on LIRC socket 2014-07-20 13:52:06 +02:00
lirc.h
pipe.c input: redo how --input-file is handled 2014-08-25 01:00:21 +02:00