summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-03-23 20:54:04 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-03-26 23:06:50 -0700
commitcdbd20581e7da8657c4b17784546f2af6c579d36 (patch)
tree8b4b7153f89efa23329cbc319d28b98d6ac89c89 /wscript
parentf60826c3a14ba3b49077f17e5364b7347f9b468a (diff)
downloadmpv-cdbd20581e7da8657c4b17784546f2af6c579d36.tar.bz2
mpv-cdbd20581e7da8657c4b17784546f2af6c579d36.tar.xz
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().
Diffstat (limited to 'wscript')
0 files changed, 0 insertions, 0 deletions