1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 10:02:17 +00:00
mpv/player
wm4 fb9bbf2a0d command: split big command handler switch into separate functions
This gets rid of run_command() and its big switch statement, which was
an idiotically big function of almost 1000 lines.

The switch is replaced with a callback per command, and each command is
now implemented in its own function. Command IDs are not needed anymore,
so the mp_command_type enum disappears.

There should be no functional changes, but since this refactors 64
commands, regressions are possible.

The handler() parameter is void*, because in theory the input code is
supposed to be independent of the player core code. For example, you
should be able to reuse the command parser code for some other part of
mpv. In practice, the variable containing command list is defined in the
player core anyway, so you could say this doesn't work. But I'm still
trying to hold onto this idea, so I went with void*.
2018-05-03 01:20:01 +03:00
..
javascript js: use new hooks API (match f60826c3) 2018-04-07 16:02:20 -07:00
lua ytdl_hook: don't log error when loading is aborted 2018-04-15 21:07:13 +03:00
audio.c build: make encoding mode non-optional 2018-05-03 01:08:44 +03:00
client.c client API: preparations for allowing render API to use DR etc. 2018-04-29 02:21:32 +03:00
client.h client API: preparations for allowing render API to use DR etc. 2018-04-29 02:21:32 +03:00
command.c command: split big command handler switch into separate functions 2018-05-03 01:20:01 +03:00
command.h command: split big command handler switch into separate functions 2018-05-03 01:20:01 +03:00
configfiles.c player: silence config file loading message on resuming 2018-01-13 03:26:45 -08:00
core.h player: remove in_dispatch field 2018-04-18 01:17:42 +03:00
external_files.c player: make track language matching case insensitive 2017-12-23 15:14:13 -07:00
external_files.h
javascript.c js: use new hooks API (match f60826c3) 2018-04-07 16:02:20 -07:00
loadfile.c build: make encoding mode non-optional 2018-05-03 01:08:44 +03:00
lua.c client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
main.c build: make encoding mode non-optional 2018-05-03 01:08:44 +03:00
misc.c options: move most subtitle and OSD rendering options to sub structs 2018-01-02 14:27:37 -08:00
osd.c build: make encoding mode non-optional 2018-05-03 01:08:44 +03:00
playloop.c build: make encoding mode non-optional 2018-05-03 01:08:44 +03:00
screenshot.c vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00
screenshot.h
scripting.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
sub.c video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
video.c encode: get rid of the output packet queue 2018-05-03 01:08:44 +03:00