mpv/player
wm4 0b35b4c917 sub: make filter_sdh a "proper" filter, allow runtime changes
Until now, filter_sdh was simply a function that was called by sd_ass
directly (if enabled).

I want to add another filter, so it's time to turn this into a somewhat
more general subtitle filtering infrastructure.

I pondered whether to reuse the audio/video filtering stuff - but better
not. Also, since subtitles are horrible and tend to refuse proper
abstraction, it's still messed into sd_ass, instead of working on the
dec_sub.c level. Actually mpv used to have subtitle "filters" and even
made subtitle converters part of it, but it was fairly horrible, so
don't do that again.

In addition, make runtime changes possible. Since this was supposed to
be a quick hack, I just decided to put all subtitle filter options into
a separate option group (=> simpler change notification), to manually
push the change through the playloop (like it was sort of before for OSD
options), and to recreate the sub filter chain completely in every
change. Should be good enough.

One strangeness is that due to prefetching and such, most subtitle
packets (or those some time ahead) are actually done filtering when we
change, so the user still needs to manually seek to actually refresh
everything. And since subtitle data is usually cached in ASS_Track (for
other terrible but user-friendly reasons), we also must clear the
subtitle data, but of course only on seek, since otherwise all subtitles
would just disappear. What a fucking mess, but such is life. We could
trigger a "refresh seek" to make this more automatic, but I don't feel
like it currently.

This is slightly inefficient (lots of allocations and copying), but I
decided that it doesn't matter. Could matter slightly for crazy ASS
subtitles that render with thousands of events.

Not very well tested. Still seems to work, but I didn't have many test
cases.
2020-02-16 02:07:24 +01:00
..
javascript js: require: directory-scripts: first look at <dir>/modules/ 2020-02-07 18:22:12 +02:00
lua ytdl_hook.lua: delay load subtitles 2020-02-15 18:30:42 +01:00
audio.c audio: slightly simplify pull underrun message printing 2020-02-13 18:02:16 +01:00
client.c scripting: load scripts from directories 2020-02-01 18:09:40 +01:00
client.h scripting: load scripts from directories 2020-02-01 18:09:40 +01:00
command.c sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
command.h command, vo: add a mechanism for runtime DPI scale changes 2020-01-09 19:13:42 +01:00
configfiles.c player: fix minor coding style issue 2020-01-26 14:29:48 +01:00
core.h scripting: load scripts from directories 2020-02-01 18:09:40 +01:00
external_files.c external_files: add .lrc subtitle extension 2019-09-02 01:25:43 +03:00
external_files.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
javascript.c js: require: directory-scripts: first look at <dir>/modules/ 2020-02-07 18:22:12 +02:00
loadfile.c playlist: change from linked list to an array 2019-12-28 21:32:15 +01:00
lua.c lua: fix typo in comment 2020-02-06 23:02:23 +01:00
main.c player: make failure to load scripts non-fatal again 2020-01-20 19:58:51 +01:00
misc.c player: add ab-loop-count option/property 2020-02-08 15:01:33 +01:00
osd.c player: format low cache duration with more decimals 2019-10-11 19:18:43 +02:00
playloop.c player: consider audio buffer if AO driver does not report underruns 2020-02-13 01:32:58 +01:00
screenshot.c screenshot: fix typo in comment 2020-02-07 13:42:42 +01:00
screenshot.h player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00
scripting.c scripting: give proper name to scripts using a directory 2020-02-06 19:38:22 +01:00
sub.c player: partially fix backward playback display of cached text subtitles 2020-02-04 20:26:35 +01:00
video.c player: make screenshot each-frame mode more accurate 2020-02-07 13:32:21 +01:00