diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-07-23 20:31:15 +0300 |
---|---|---|
committer | avih <avih@users.noreply.github.com> | 2021-08-05 21:32:22 +0300 |
commit | 41650203c32e179e5f3cf89e176ef6caccba05d9 (patch) | |
tree | 21bb2a4682f33be0ff99f52a3ba3efe847b4d1cb /sub/sd.h | |
parent | 7c264950c0bff588f6852c461c26b37a550a5abb (diff) | |
download | mpv-41650203c32e179e5f3cf89e176ef6caccba05d9.tar.bz2 mpv-41650203c32e179e5f3cf89e176ef6caccba05d9.tar.xz |
sub: sub-filter-regex and jsre: support ass-to-plaintext
Using --sub-filter-regex-plain (default:no)
The ass-to-plaintext functionality already existed at sd_ass.c, but
it's internal and uses a private buffer type, so a trivial utility
wrapper was added with standard char*/bstr interface.
The plaintext can be multi-line, and the multi-line regexp flag is now
always set, but only affects plaintext (the ASS source is one line).
Diffstat (limited to 'sub/sd.h')
-rw-r--r-- | sub/sd.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -101,4 +101,9 @@ int sd_ass_fmt_offset(const char *event_format); // on malformed event: warns and returns (bstr){NULL,0} bstr sd_ass_pkt_text(struct sd_filter *ft, struct demux_packet *pkt, int offset); +// convert \0-terminated "Text" (ass) content to plaintext, possibly in-place. +// result.start is out, result.len is MIN(out_siz, strlen(in)) or smaller. +// if there's room: out[result.len] is set to \0. out == in is allowed. +bstr sd_ass_to_plaintext(char *out, size_t out_siz, const char *in); + #endif |