summaryrefslogtreecommitdiffstats
path: root/input/cmd.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-01 02:38:59 +0200
committerJan Ekström <jeebjp@gmail.com>2018-05-03 01:20:01 +0300
commitfb9bbf2a0d7f8dba0d0674595cc2dc0dab68ad94 (patch)
treeb386f221e961ad81e35a3bc23bb66320ba942b80 /input/cmd.h
parente8b073584d749bb864f495d9e1cd31b102c6283d (diff)
downloadmpv-fb9bbf2a0d7f8dba0d0674595cc2dc0dab68ad94.tar.bz2
mpv-fb9bbf2a0d7f8dba0d0674595cc2dc0dab68ad94.tar.xz
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*.
Diffstat (limited to 'input/cmd.h')
0 files changed, 0 insertions, 0 deletions