diff options
author | wm4 <wm4@nowhere> | 2018-05-01 02:38:59 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-05-03 01:20:01 +0300 |
commit | fb9bbf2a0d7f8dba0d0674595cc2dc0dab68ad94 (patch) | |
tree | b386f221e961ad81e35a3bc23bb66320ba942b80 /input/input.h | |
parent | e8b073584d749bb864f495d9e1cd31b102c6283d (diff) | |
download | mpv-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/input.h')
0 files changed, 0 insertions, 0 deletions