mpv/player
wm4 d2bdb72b69 options: add a thread-safe way to notify option updates
So far, we had a thread-safe way to read options, but no option update
notification mechanism. Everything was funneled though the main thread's
central mp_option_change_callback() function. For example, if the
panscan options were changed, the function called vo_control() with
VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This
worked, but's pretty inconvenient. Most of these problems come from the
fact that MPlayer was written as a single-threaded program.

This commit works towards a more flexible mechanism. It adds an update
callback to m_config_cache (the thing that is already used for
thread-safe access of global options).

This alone would still be rather inconvenient, at least in context of
VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and
takes care of some annoying synchronization issues. We extend
mp_dispatch_queue itself to make this easier and slightly more
efficient.

As a first application, use this to reimplement certain VO scaling and
renderer options. The update_opts() function translates these to the
"old" VOCTRLs, though.

An annoyingly subtle issue is that m_config_cache's destructor now
releases pending notifications, and must be released before the
associated dispatch queue. Otherwise, it could happen that option
updates during e.g. VO destruction queue or run stale entries, which is
not expected.

Rather untested. The singly-linked list code in dispatch.c is probably
buggy, and I bet some aspects about synchronization are not entirely
sane.
2017-08-22 15:50:33 +02:00
..
javascript js: add javascript scripting support using MuJS 2017-06-14 12:29:32 +02:00
lua ytdl_hook: support fragments with relative paths 2017-08-06 13:27:53 +01:00
audio.c audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
client.c client API: change mpv_create() behavior, run init always on mpv thread 2017-06-30 13:14:39 +02:00
client.h client API: turn mpv_suspend() and mpv_resume() into stubs 2016-11-22 15:54:44 +01:00
command.c options: add a thread-safe way to notify option updates 2017-08-22 15:50:33 +02:00
command.h player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
configfiles.c player: change default section when loading encoding-profiles.conf 2017-07-12 13:11:14 +02:00
core.h audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
external_files.c player: readd smi subtitle extension 2017-08-08 11:37:04 +02:00
external_files.h external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
javascript.c js: utils.getenv(): fix crash on undefined var 2017-07-06 18:11:24 +03:00
lavfi.c audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
lavfi.h audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
loadfile.c audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
lua.c scripting: expand --script filename for C plugins 2017-06-09 19:42:12 +02:00
main.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
misc.c player: make refresh seeks slightly more robust 2017-08-14 14:02:13 +02:00
osd.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
playloop.c audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
screenshot.c screenshot: cleanup: use normal MSGL_ defines 2017-04-01 20:47:36 +02:00
screenshot.h player: make screenshot commands honor the async flag 2017-04-01 20:47:23 +02:00
scripting.c scripting: add wrapper to load scripts with user paths 2017-06-30 15:03:10 +01:00
sub.c player: change license of most core files to LGPL 2017-06-23 16:55:02 +02:00
video.c audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00