1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00
mpv/osdep
James Ross-Gowan 6a8d1cdd49 terminal-win: clean up console input
The original version of this code in getch2-win.c fetched 128 console
events at once. This was probably to maximize the chance of getting a
key event if there were other events in the buffer, because it returned
the value of the first key event it found and ignored all others. Since
that code was written, it has been modified to receive console input in
an event-based way using an input thread, so it is probably not
necessary to fetch so many events at once any more. Also, I'm not sure
what it would have done if there were more than 128 events in the
console input buffer. It's possible that fetching multiple events at a
time also had performance advantages, but I can't find any other
programs that do this. Even libuv just fetches one console event at a
time.

Change read_input() to fetch only one event at a time and to consume all
available events before returning to WaitForMultipleObjects. Also remove
some outdated comments and pass the console handle through to the input
thread instead of calling GetStdHandle multiple times (I think this is
theoretically more correct because it is possible for the handles
returned by GetStdHandle to be changed by other threads.)
2016-10-14 08:44:33 +11:00
..
android Initial Android support 2016-02-10 21:29:36 +01:00
ar Fix misspellings 2016-06-26 13:47:21 +02:00
win32 win32: pthread: use SRW locks by default 2016-05-24 19:02:22 +02:00
atomic.h osdep: rename atomics.h to atomic.h 2016-09-07 11:26:25 +02:00
compiler.h
endian.h
glob-win.c glob-win: relicense to LGPL 2016-02-18 22:57:28 +11:00
io.c osdep/io: introduce mp_flush_wakeup_pipe() 2016-07-30 00:02:39 +02:00
io.h osdep/io: introduce mp_flush_wakeup_pipe() 2016-07-30 00:02:39 +02:00
macosx_application_objc.h
macosx_application.h
macosx_application.m Use - as command-name separator everywhere 2016-07-14 22:37:42 +02:00
macosx_compat.h cocoa: fix macOS 10.12 deprecation warnings 2016-09-22 13:46:27 +02:00
macosx_events_objc.h
macosx_events.h
macosx_events.m cocoa: fix macOS 10.12 deprecation warnings 2016-09-22 13:46:27 +02:00
macosx_versions.h cocoa: fix macOS 10.12 deprecation warnings 2016-09-22 13:46:27 +02:00
main-fn-cocoa.c
main-fn-unix.c
main-fn-win.c player: do not let pseudo-gui override user config settings 2016-09-23 21:24:50 +02:00
main-fn.h
mpv.exe.manifest
mpv.rc win32: mpv.rc: re-add version info 2016-07-12 21:05:33 +10:00
path-macosx.m
path-unix.c
path-win.c win32: build with -DINITGUID 2016-09-28 21:38:52 +10:00
path.h
semaphore_osx.c
semaphore.h
strnlen.h Initial Android support 2016-02-10 21:29:36 +01:00
subprocess-posix.c
subprocess-win.c osdep: rename atomics.h to atomic.h 2016-09-07 11:26:25 +02:00
subprocess.c subprocess: add a callback to ignore output 2016-07-05 19:15:59 +02:00
subprocess.h subprocess: add a callback to ignore output 2016-07-05 19:15:59 +02:00
terminal-unix.c player: make --terminal freetly settable at runtime 2016-09-19 19:54:54 +02:00
terminal-win.c terminal-win: clean up console input 2016-10-14 08:44:33 +11:00
terminal.h
threads.c
threads.h
timer-darwin.c
timer-linux.c
timer-win2.c
timer.c
timer.h
w32_keyboard.c
w32_keyboard.h
win32-console-wrapper.c
windows_utils.c windows_utils: try and use FormatMessage for errors. 2016-02-17 06:58:56 -08:00
windows_utils.h windows_utils: try and use FormatMessage for errors. 2016-02-17 06:58:56 -08:00