0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 20:03:10 +02:00
mpv/player
wm4 6aad532aa3 options: move most subtitle and OSD rendering options to sub structs
Remove them from the big MPOpts struct and move them to their sub
structs. In the places where their fields are used, create a private
copy of the structs, instead of accessing the semi-deprecated global
option struct instance (mpv_global.opts) directly.

This actually makes accessing these options finally thread-safe. They
weren't even if they should have for years. (Including some potential
for undefined behavior when e.g. the OSD font was changed at runtime.)

This is mostly transparent. All options get moved around, but most users
of the options just need to access a different struct (changing sd.opts
to a different type changes a lot of uses, for example).

One thing which has to be considered and could cause potential
regressions is that the new option copies must be explicitly updated.
sub_update_opts() takes care of this for example.

Another thing is that writing to the option structs manually won't work,
because the changes won't be propagated to other copies. Apparently the
only affected case is the implementation of the sub-step command, which
tries to change sub_delay. Handle this one explicitly (osd_changed()
doesn't need to be called anymore, because changing the option triggers
UPDATE_OSD, and updates the OSD as a consequence). The way the option
value is propagated is rather hacky, but for now this will do.
2018-01-02 14:27:37 -08:00
..
javascript js: implement mp.msg.trace() 2017-12-16 02:25:24 -08:00
lua player: add on_load_fail hook 2018-01-02 16:01:22 +00:00
audio.c options: drop some previously deprecated options 2017-12-25 04:06:17 -07:00
client.c client: Allow "C.UTF-8" as LC_NUMERIC locale 2017-11-30 21:06:37 +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: move most subtitle and OSD rendering options to sub structs 2018-01-02 14:27:37 -08:00
command.h player: update duration based on highest timestamp demuxed 2017-12-24 21:49:12 +01:00
configfiles.c player: change default section when loading encoding-profiles.conf 2017-07-12 13:11:14 +02:00
core.h options: drop some previously deprecated options 2017-12-25 04:06:17 -07:00
external_files.c player: make track language matching case insensitive 2017-12-23 15:14:13 -07:00
external_files.h external_files: change license to LGPL 2017-06-20 14:22:10 +02:00
javascript.c lua+js: implement utils.file_info() 2017-12-13 21:55:28 +02:00
lavfi.c lavfi: fix warnings with newer libavfilter versions 2017-10-27 18:09:08 +02:00
lavfi.h audio: introduce a new type to hold audio frames 2017-08-16 21:10:54 +02:00
loadfile.c player: add on_load_fail hook 2018-01-02 16:01:22 +00:00
lua.c msg: reinterpret a bunch of message levels 2017-12-15 22:28:47 -08:00
main.c build: move copyright statement to a shared location 2018-01-01 21:05:09 +00:00
misc.c options: move most subtitle and OSD rendering options to sub structs 2018-01-02 14:27:37 -08:00
osd.c player: show demuxer cache buffered amount in bytes in the status line 2017-12-23 00:32:59 +01:00
playloop.c player/playloop.c: Revert --loop-file and --start interaction 2017-12-31 17:02:55 -07:00
screenshot.c screenshot: create directories from template 2017-11-02 17:07:35 +01:00
screenshot.h player: make screenshot commands honor the async flag 2017-04-01 20:47:23 +02:00
scripting.c msg: reinterpret a bunch of message levels 2017-12-15 22:28:47 -08:00
sub.c sub: move all subtitle timestamp messing code to a central place 2018-01-02 14:27:37 -08:00
video.c msg: reinterpret a bunch of message levels 2017-12-15 22:28:47 -08:00