1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 10:02:17 +00:00
mpv/sub
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
..
ass_mp.c ass_mp: reset packer when allocation fails 2019-11-02 14:42:36 +01:00
ass_mp.h ass_mp: change license to LGPL 2017-04-20 12:53:09 +02:00
dec_sub.c sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
dec_sub.h sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
draw_bmp.c Replace uses of FFMIN/MAX with MPMIN/MAX 2019-10-31 11:24:20 +01:00
draw_bmp.h
filter_sdh.c sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
img_convert.c Replace uses of FFMIN/MAX with MPMIN/MAX 2019-10-31 11:24:20 +01:00
img_convert.h sub: move RGBA scaling to vo_vaapi 2016-07-03 19:32:43 +02:00
lavc_conv.c sub/lavc_conv: skip ReadOrder reset when subtitle decoder gets flushed 2019-09-21 22:02:17 +03:00
osd_dummy.c client API, lua: add new API for setting OSD overlays 2019-12-23 11:44:24 +01:00
osd_font.otf osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osd_libass.c client API, lua: add new API for setting OSD overlays 2019-12-23 11:44:24 +01:00
osd_state.h client API, lua: add new API for setting OSD overlays 2019-12-23 11:44:24 +01:00
osd.c osd: fix possible misses of osd-dimensions property updates 2020-01-08 02:31:18 +01:00
osd.h client API, lua: add new API for setting OSD overlays 2019-12-23 11:44:24 +01:00
sd_ass.c sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00
sd_lavc.c sd_lavc: add a hack ontop of another hack to fix completely fucked file 2019-12-03 22:33:45 +01:00
sd.h sub: make filter_sdh a "proper" filter, allow runtime changes 2020-02-16 02:07:24 +01:00