mpv/TOOLS
wm4 ba70b150fb client API: provide ways to finish property changes on file changes
When the current file changes (or rather, when starting/finishing
playback of a playlist entry), clients tend to have the problem that
it's hard to tell whether a property change notification (via
mpv_observe_property() and mechanisms layered on top of it) is from the
previous or new playlist entry. The previous commit probably helps, but
all the asynchronity is still a bit unhelpful.

Try to make this better by adding new hooks, that are run before/after
playback init/deinit. This is similar to the existing hooks, except
they're outside of "initialized" playback, which excludes that you might
accidentally get an overlap between the current and the previous/next
playlist entry.

That still doesn't seem quite enough, since normally, property change
notifications come after the hook event. So basically a client would
have to explicitly "drain" the event queue within the hook, and make the
hook continue only after that is done. Knowing when property
notifications are done is another asynchronous nightmare (how exactly it
works keeps changing within client.c, and an API user probably can't
tell anymore when all pending properties are truly done). So introduce
another guarantee: properties that were changed before the hook happens
will be returned before the hook event is returned. That means the
client will have received all pending property notifications from the
previous playlist entry (or whatever) before the hook is entered.

As another minor complication, we shouldn't just keep the hook pending
until _all_ property notifications are done, since the client's hook
could produce new ones. (Or just consider things like the demuxer thread
hammering the client with cache update events, while the "on_preloaded"
hook is run.) So there is some extra untested, fragile logic in client.c
to handle this (the waiting_for_hook flag).

This probably works, but was barely tested. Not sure if this helps
anyone, but I think it's fine for my own purposes. (I really hated this
aspect of the API whenever I used it myself.)
2020-03-07 02:52:10 +01:00
..
lua client API: provide ways to finish property changes on file changes 2020-03-07 02:52:10 +01:00
mpv-osd-symbols.sfdir osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osxbundle/mpv.app/Contents mac: activate logging when started from the bundle 2020-02-08 10:55:07 +01:00
__init__.py
appveyor-build.sh appveyor: remove broken packages, install libplacebo 2019-07-03 17:30:50 +03:00
appveyor-install.sh appveyor: remove broken packages, install libplacebo 2019-07-03 17:30:50 +03:00
dylib-unhell.py osxbundle: simplify process_libraries() to eliminate leafs() 2019-12-15 12:33:25 +01:00
file2string.py
gen-osd-font.sh
idet.sh
matroska.py *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
mpv_identify.sh
osxbundle.py *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
stats-conv.py *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
travis-deps travis: stop excluding ffmpeg-git 2017-12-22 21:49:21 +01:00
travis-rebuild-website TOOLS/travis-rebuild-website: update condition after docker transition 2019-07-30 20:12:33 +01:00
umpv
uncrustify.cfg