1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

sub: use libass even if -no-ass is used

The -no-ass option used to disable all use of libass completely. This
doesn't work this way anymore, and the text subtitle path has an
inherent dependency on libass. Currently -no-ass does 3 things:

1. Strip tags and formatting on display, and use a separate renderer for
   the result. (Which might be the terminal, or libass via OSD code.)
2. Not loading attached fonts from Matroska files.
3. Use subreader.c instead of libass for reading .ass files.

1. and 2. are ok and what the user (probably wants), but 3. doesn't
really make sense anymore. subreader.c reads .ass files just fine, but
then does some strange things to them (something about coalescing and
re-adding newlines?), leading to even more broken display with -no-ass.
Instead of fighting with subreader.c, just use libass as loader.
This commit is contained in:
wm4 2013-06-02 19:57:37 +02:00
parent 74e3ac8bf8
commit d5520d20b2
2 changed files with 5 additions and 8 deletions
DOCS/man/en
core

View File

@ -90,13 +90,11 @@
- ``--aspect=16:9`` or ``--aspect=1.7777``
--ass, --no-ass
Render ASS subtitles natively, and convert text subtitles in other formats
to ASS internally (enabled by default).
Render ASS subtitles natively (enabled by default).
If ``--no-ass`` is specified, all subtitles are converted to plain text
internally. All tags and style declarations are stripped and ignored. The
subtitle renderer uses the font style as specified by the ``--sub-text-``
options instead.
If ``--no-ass`` is specified, all tags and style declarations are stripped
and ignored on display. The subtitle renderer uses the font style as
specified by the ``--sub-text-`` options instead.
*NOTE*: Using ``--no-ass`` may lead to incorrect or completely broken
rendering of ASS/SSA subtitles. It can sometimes be useful to forcibly

View File

@ -1061,8 +1061,7 @@ struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename,
// through sd_ass makes the code much simpler, as sd_ass can handle all
// the weird special-cases.
#ifdef CONFIG_ASS
if (opts->ass_enabled)
asst = mp_ass_read_stream(mpctx->ass_library, filename, opts->sub_cp);
asst = mp_ass_read_stream(mpctx->ass_library, filename, opts->sub_cp);
if (!asst)
subd = sub_read_file(filename, fps, &mpctx->opts);
if (asst || subd) {