summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-08-12 17:28:08 +0200
committerwm4 <wm4@nowhere>2020-08-12 17:28:25 +0200
commitcda8f1613ff307a9e0b5528743f3e941b05dcee7 (patch)
tree248182c3e4207b11abd11c39488303c76f4e4c32 /options
parent720bcd79d0304dd82e607efa95d421f402c8a3dd (diff)
downloadmpv-cda8f1613ff307a9e0b5528743f3e941b05dcee7.tar.bz2
mpv-cda8f1613ff307a9e0b5528743f3e941b05dcee7.tar.xz
sd_ass: force full reinit if certain options change at runtime
Options like --sub-ass-force-style and others could not be changed at runtime (the changes didn't take any effect). Fix this by using the brutal approach, and completely reinit the subtitle state when this happens. Maybe a bit clunky, but for now I'd rather not put more effort into this. Fixes: #7689
Diffstat (limited to 'options')
-rw-r--r--options/m_option.h3
-rw-r--r--options/options.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/options/m_option.h b/options/m_option.h
index 25dc212482..bfaaef8d07 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -420,7 +420,8 @@ char *format_file_size(int64_t size);
#define UPDATE_VO_RESIZE (1 << 19) // --android-surface-size
#define UPDATE_HWDEC (1 << 20) // --hwdec
#define UPDATE_DVB_PROG (1 << 21) // some --dvbin-...
-#define UPDATE_OPT_LAST (1 << 21)
+#define UPDATE_SUB_HARD (1 << 22) // subtitle opts. that need full reinit
+#define UPDATE_OPT_LAST (1 << 22)
// All bits between _FIRST and _LAST (inclusive)
#define UPDATE_OPTS_MASK \
diff --git a/options/options.c b/options/options.c
index 63c99053a8..efde6fad4b 100644
--- a/options/options.c
+++ b/options/options.c
@@ -235,7 +235,7 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"sub-pos", OPT_INT(sub_pos), M_RANGE(0, 100)},
{"sub-gauss", OPT_FLOAT(sub_gauss), M_RANGE(0.0, 3.0)},
{"sub-gray", OPT_FLAG(sub_gray)},
- {"sub-ass", OPT_FLAG(ass_enabled)},
+ {"sub-ass", OPT_FLAG(ass_enabled), .flags = UPDATE_SUB_HARD},
{"sub-scale", OPT_FLOAT(sub_scale), M_RANGE(0, 100)},
{"sub-ass-line-spacing", OPT_FLOAT(ass_line_spacing),
M_RANGE(-1000, 1000)},
@@ -245,9 +245,11 @@ const struct m_sub_options mp_subtitle_sub_opts = {
{"sub-ass-vsfilter-color-compat", OPT_CHOICE(ass_vsfilter_color_compat,
{"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})},
{"sub-ass-vsfilter-blur-compat", OPT_FLAG(ass_vsfilter_blur_compat)},
- {"embeddedfonts", OPT_FLAG(use_embedded_fonts)},
- {"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list)},
- {"sub-ass-styles", OPT_STRING(ass_styles_file), .flags = M_OPT_FILE},
+ {"embeddedfonts", OPT_FLAG(use_embedded_fonts), .flags = UPDATE_SUB_HARD},
+ {"sub-ass-force-style", OPT_STRINGLIST(ass_force_style_list),
+ .flags = UPDATE_SUB_HARD},
+ {"sub-ass-styles", OPT_STRING(ass_styles_file), .flags = M_OPT_FILE,
+ .flags = UPDATE_SUB_HARD},
{"sub-ass-hinting", OPT_CHOICE(ass_hinting,
{"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})},
{"sub-ass-shaper", OPT_CHOICE(ass_shaper,