mpv/sub
llyyr 580f36e436 sd_ass: fix converted subtitles having too-wide borders
Libass commit f08f8ea5 (between 0.16 and 0.17) changed how PlayResX
affects some aspects of rendering.

The libass change fixes a VSFilter compatibility issue which existed
for about two decades, and there are no libass plans to support the
previous behavior, so ultimately we have to adjust the mpv code, and
we can't guarantee to restore the old behavior in all cases.

Starting at this commit, vector drawing coords, font spacing, border
and shadow widths are all affected by PlayResX (specifically, by
the aspect), while previously they were unaffected by PlayResX.

This changed converted sub border and shadow widths in mpv, because
ffmpeg generates the ass with fixed PlayResX of 384 (aspect of 4:3),
and with libass 0.17, if this doesn't match the display aspect, then
borders and shadow were too wide - because most clips aspect is more
than 4:3.

The fact that ffmpeg uses fixed PlayResX of 384 could be considered
an issue, but for now we have no control over it, and ffmpeg doesn't
have the video resolution when it converts an srt source to ass.

So here we adjust PlayResX accordingly so that border/shadows are
now rendered with correct width.

However, regardless of that commit, changing PlayResX also affects
the margin value, so to compensate, we adjust sub-margins-x too.

According to libass devs, this should cover basic srt-to-ass
conversion by ffmpeg to work correctly with libass 0.17.

However, there could be srt extensions which use more complex ass,
and/or ffmpeg conversion of other sub formats (such as aribb24,
aribcaption and movtext), where more things need adjustments.
As of now we don't know what these are, and so we don't really know
what else might remain broken or get broken.
2023-07-16 21:02:54 +03:00
..
ass_mp.c sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
ass_mp.h sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
dec_sub.c sub: rewrite auto-forced-only support 2023-06-25 11:01:58 +02:00
dec_sub.h sub: rewrite auto-forced-only support 2023-06-25 11:01:58 +02:00
draw_bmp.c draw_bmp: ensure last slice is less than total width (again) 2023-07-12 19:19:54 +00:00
draw_bmp.h test: integrate unittests with meson 2023-03-02 15:45:27 +00:00
filter_jsre.c sub: jsre filter: abort init early on empty filter list 2022-06-09 14:38:24 +03:00
filter_regex.c sub: sub-filter-regex and jsre: support ass-to-plaintext 2021-08-05 21:32:22 +03:00
filter_sdh.c various: fix various typos in the code base 2023-03-28 19:29:44 +00:00
img_convert.c Replace uses of FFMIN/MAX with MPMIN/MAX 2019-10-31 11:24:20 +01:00
img_convert.h
lavc_conv.c sub/lavc_conv: properly fill avctx with codecpar values at init 2023-03-14 23:59:47 +02:00
osd.c mp_image: abort on av_buffer_ref() failure 2023-06-28 20:56:23 -07:00
osd.h sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
osd_font.otf osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osd_libass.c sub: add --sub-fonts-dir and --osd-fonts-dir options 2023-03-01 02:09:46 +00:00
osd_state.h sub/osd: use atomic for osd_state.force_video_pts 2022-04-02 21:41:58 +03:00
sd.h sub: rewrite auto-forced-only support 2023-06-25 11:01:58 +02:00
sd_ass.c sd_ass: fix converted subtitles having too-wide borders 2023-07-16 21:02:54 +03:00
sd_lavc.c sub: rewrite auto-forced-only support 2023-06-25 11:01:58 +02:00