diff options
author | wm4 <wm4@nowhere> | 2013-04-26 19:48:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-26 20:44:18 +0200 |
commit | 7bc4b18cee071d57195147c89519f1025635fbd7 (patch) | |
tree | d788af0c15850984b73151f6ed48d6523d97d73f /version.sh | |
parent | 56efcc7b7f609f3dfd5a0060d0b8b700cde75890 (diff) | |
download | mpv-7bc4b18cee071d57195147c89519f1025635fbd7.tar.bz2 mpv-7bc4b18cee071d57195147c89519f1025635fbd7.tar.xz |
subassconvert: do not escape likely ASS override tags
Usually SubRip files are not expected to contain ASS override tags,
but unfortunately these files seem to become more common. Example from
a real file:
1
00:00:00,800 --> 00:00:15,000
{\an8}本字幕由 {\c&H26F4FF&}ShinY {\c&HFFAE1A&}深影字幕组{\c&HFFFFFF&} 原创翻译制作
subassconvert.c escaped '{', so that libass displayed the above line
literally.
Try to apply a simple heuristic to detect whether '{' is likely to
start an ASS tag: if the string starts with '{\', and there is a
closing '}', assume it's an ASS tag, otherwise escape the '{' properly.
If it's a likely ASS tag, it's passed through to libass.
The end result is that the above script is displayed in color, while at
the same time legitimate uses of '{' and '}' should work fine. We assume
that nobody uses {...} for commenting text in SubRip files. (This kind
of comment is popular and legal in ASS files, though.)
Diffstat (limited to 'version.sh')
0 files changed, 0 insertions, 0 deletions