diff options
author | Dudemanguy <random342@airmail.cc> | 2023-11-05 12:51:43 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2023-12-08 18:14:06 +0000 |
commit | ce958b77424327a30a3026c226a1db72f26e3543 (patch) | |
tree | 89cdf473787eb1b43055e73db5ffbb86d7cdfb5f /options | |
parent | b7d85f0d4a5330cb3f433cd0cb4c977e10a168f7 (diff) | |
download | mpv-ce958b77424327a30a3026c226a1db72f26e3543.tar.bz2 mpv-ce958b77424327a30a3026c226a1db72f26e3543.tar.xz |
filter_sdh: add --sub-filter-sdh-enclosures option
This filter is a bit complicated, but one of the essential parts of it
is removing text enclosed by particular set of characters (e.g. text
inbetween []). This was previously hardcoded to only take into account
parenthesis and brackets, but people may want to filter more things so
make this customizable. The option only takes "left hand characters" so
the right pair is mapped internally if applicable. If not, then we just
use the same character. Fixes #8268 since the unicode character in
question can just be passed to this option.
Diffstat (limited to 'options')
-rw-r--r-- | options/options.c | 2 | ||||
-rw-r--r-- | options/options.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c index be7d966a95..84f94c59b7 100644 --- a/options/options.c +++ b/options/options.c @@ -262,6 +262,7 @@ const struct m_sub_options mp_sub_filter_opts = { .opts = (const struct m_option[]){ {"sub-filter-sdh", OPT_BOOL(sub_filter_SDH)}, {"sub-filter-sdh-harder", OPT_BOOL(sub_filter_SDH_harder)}, + {"sub-filter-sdh-enclosures", OPT_STRING(sub_filter_SDH_enclosures)}, {"sub-filter-regex-enable", OPT_BOOL(rf_enable)}, {"sub-filter-regex-plain", OPT_BOOL(rf_plain)}, {"sub-filter-regex", OPT_STRINGLIST(rf_items)}, @@ -271,6 +272,7 @@ const struct m_sub_options mp_sub_filter_opts = { }, .size = sizeof(OPT_BASE_STRUCT), .defaults = &(OPT_BASE_STRUCT){ + .sub_filter_SDH_enclosures = "([", .rf_enable = true, }, .change_flags = UPDATE_SUB_FILT, diff --git a/options/options.h b/options/options.h index 28a8c90adb..f1940266ca 100644 --- a/options/options.h +++ b/options/options.h @@ -123,6 +123,7 @@ struct mp_subtitle_opts { struct mp_sub_filter_opts { bool sub_filter_SDH; bool sub_filter_SDH_harder; + char *sub_filter_SDH_enclosures; bool rf_enable; bool rf_plain; char **rf_items; |