Skip to content

Commit f6c1164

Browse files
guidocellasfan5
authored andcommitted
DOCS/man/input: don't discourage hook usage
This paragraph was added 10 years ago in f8dc5db. Hooks are now commonly used both in internal (ytdl_hook, auto_profiles) and external scripts (e.g. https://github.com/mpv-player/mpv/issues?q=mp.add_hook). They are the only way to handle events synchronously and nobody is just going to change the API and break all scripts at this point, so remove the warning.
1 parent 1f4cf13 commit f6c1164

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

DOCS/man/input.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,10 +1893,10 @@ Hooks
18931893

18941894
Hooks are synchronous events between player core and a script or similar. This
18951895
applies to client API (including the Lua scripting interface). Normally,
1896-
events are supposed to be asynchronous, and the hook API provides an awkward
1897-
and obscure way to handle events that require stricter coordination. There are
1898-
no API stability guarantees made. Not following the protocol exactly can make
1899-
the player freeze randomly. Basically, nobody should use this API.
1896+
events are supposed to be asynchronous, and the hook API provides a way to
1897+
handle events that require stricter coordination. Not following the protocol
1898+
exactly can make the player freeze. Use with caution, avoid if synchronous event
1899+
handling is not required.
19001900

19011901
The C API is described in the header files. The Lua API is described in the
19021902
Lua section.

0 commit comments

Comments
 (0)