1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 07:42:17 +00:00
mpv/player
wm4 cdbd20581e
player: fix hook processing consistency and code duplication issues
There was a "generic" function to run a hook and to wait for its
completion, yet there were two duplicated functions doing the same
anyway. Replace them with a single function.

They differed in how stop_play was handled, but it was broken anyway.
stop_play is set when playback is stopped due to quitting or changing
the playlist entry - but we still can't stop hook processing, because
that would mean asynchronously doing something else while the user hook
code is still busy and might still have the expectation that running the
hook stops everything else. So not waiting until the hook ends properly
is against the whole hook idea. That this was done inconsistently is
even worse. (Though it could be argued that when quitting the player,
everything should just be stopped violently. But I still think that's
up to the hook handler.)

process_hooks() does not return anything, since hook processing doesn't
really have a result (it's all about blocking and letting some other
code synchronously do something). Just let the caller check whether
loading was aborted in the meantime.

Also change the potentially misleading name of mp_hook_run().
2018-03-26 23:06:50 -07:00
..
javascript js: implement mp.msg.trace() 2017-12-16 02:25:24 -08:00
lua client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
audio.c audio: improve behavior if filters output nothing during probing 2018-02-21 22:35:24 -08:00
client.c client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
client.h client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
command.c player: fix hook processing consistency and code duplication issues 2018-03-26 23:06:50 -07:00
command.h player: fix hook processing consistency and code duplication issues 2018-03-26 23:06:50 -07:00
configfiles.c player: silence config file loading message on resuming 2018-01-13 03:26:45 -08:00
core.h client API: cleanup mpv_handle termination 2018-03-15 00:00:04 -07:00
external_files.c player: make track language matching case insensitive 2017-12-23 15:14:13 -07:00
external_files.h
javascript.c lua+js: Implement utils.getpid() 2018-02-13 20:16:01 -08:00
loadfile.c player: fix hook processing consistency and code duplication issues 2018-03-26 23:06:50 -07: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 client API: cleanup mpv_handle termination 2018-03-15 00:00:04 -07:00
misc.c options: move most subtitle and OSD rendering options to sub structs 2018-01-02 14:27:37 -08:00
osd.c video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
playloop.c client API: deprecate opengl-cb API and introduce a replacement API 2018-02-28 00:55:06 -08:00
screenshot.c vo_gpu: make screenshots use the GL renderer 2018-02-11 17:45:51 -08:00
screenshot.h
scripting.c client API: add a first class hook API, and deprecate old API 2018-03-26 23:02:23 -07:00
sub.c video: make decoder wrapper a filter 2018-01-30 03:10:27 -08:00
video.c vo: pass through framedrop flag differently 2018-03-15 23:13:53 -07:00