summaryrefslogtreecommitdiffstats
path: root/sub
diff options
context:
space:
mode:
authorChristoph Heinrich <christoph.heinrich@student.tugraz.at>2024-02-27 02:21:45 +0100
committerDudemanguy <random342@airmail.cc>2024-02-27 19:50:03 +0000
commit505a08a37fc30fb1b2d06ecacb358927dd9ad8cf (patch)
tree5e1e46bdbbb5e42e3fecc45a6641c035b7875d89 /sub
parentc7ff037fddf3bff2faa2f157163bca3207be2e2c (diff)
downloadmpv-505a08a37fc30fb1b2d06ecacb358927dd9ad8cf.tar.bz2
mpv-505a08a37fc30fb1b2d06ecacb358927dd9ad8cf.tar.xz
sd_ass: don't wrongly recognize \pos as \p
An ass event like `{\p1\pos{1,1}}m 0 0 l -3 -7 l 11 -7 l 11 -2` ends the drawing mode started with `\p1` due to `\pos` gets confused with `\p`, and thus that line is wrongly considered to be visible text.
Diffstat (limited to 'sub')
-rw-r--r--sub/sd_ass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 75cba616ef..e7eb740bd6 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -724,7 +724,7 @@ static void ass_to_plaintext(struct buf *b, const char *in)
if (in[0] == '}') {
in += 1;
in_tag = false;
- } else if (in[0] == '\\' && in[1] == 'p') {
+ } else if (in[0] == '\\' && in[1] == 'p' && in[2] != 'o') {
in += 2;
// Skip text between \pN and \p0 tags. A \p without a number
// is the same as \p0, and leading 0s are also allowed.