diff options
Diffstat (limited to 'options')
-rw-r--r-- | options/m_option.h | 1 | ||||
-rw-r--r-- | options/options.c | 16 | ||||
-rw-r--r-- | options/options.h | 9 |
3 files changed, 22 insertions, 4 deletions
diff --git a/options/m_option.h b/options/m_option.h index a78def276b..9eb994a5cf 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -413,6 +413,7 @@ char *format_file_size(int64_t size); // certain groups of options. #define UPDATE_OPT_FIRST (1 << 8) #define UPDATE_TERM (1 << 8) // terminal options +#define UPDATE_SUB_FILT (1 << 9) // subtitle filter options #define UPDATE_OSD (1 << 10) // related to OSD rendering #define UPDATE_BUILTIN_SCRIPTS (1 << 11) // osc/ytdl/stats #define UPDATE_IMGPAR (1 << 12) // video image params overrides diff --git a/options/options.c b/options/options.c index 489f1bc4ed..73cd7ff76c 100644 --- a/options/options.c +++ b/options/options.c @@ -195,6 +195,19 @@ const struct m_sub_options vo_sub_opts = { }; #undef OPT_BASE_STRUCT +#define OPT_BASE_STRUCT struct mp_sub_filter_opts + +const struct m_sub_options mp_sub_filter_opts = { + .opts = (const struct m_option[]){ + OPT_FLAG("sub-filter-sdh", sub_filter_SDH, 0), + OPT_FLAG("sub-filter-sdh-harder", sub_filter_SDH_harder, 0), + {0} + }, + .size = sizeof(OPT_BASE_STRUCT), + .change_flags = UPDATE_SUB_FILT, +}; + +#undef OPT_BASE_STRUCT #define OPT_BASE_STRUCT struct mp_subtitle_opts const struct m_sub_options mp_subtitle_sub_opts = { @@ -212,8 +225,6 @@ const struct m_sub_options mp_subtitle_sub_opts = { OPT_FLOATRANGE("sub-gauss", sub_gauss, 0, 0.0, 3.0), OPT_FLAG("sub-gray", sub_gray, 0), OPT_FLAG("sub-ass", ass_enabled, 0), - OPT_FLAG("sub-filter-sdh", sub_filter_SDH, 0), - OPT_FLAG("sub-filter-sdh-harder", sub_filter_SDH_harder, 0), OPT_FLOATRANGE("sub-scale", sub_scale, 0, 0, 100), OPT_FLOATRANGE("sub-ass-line-spacing", ass_line_spacing, 0, -1000, 1000), OPT_FLAG("sub-use-margins", sub_use_margins, 0), @@ -555,6 +566,7 @@ static const m_option_t mp_opts[] = { ({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})), OPT_SUBSTRUCT("", subs_rend, mp_subtitle_sub_opts, 0), + OPT_SUBSTRUCT("", subs_filt, mp_sub_filter_opts, 0), OPT_SUBSTRUCT("", osd_rend, mp_osd_render_sub_opts, 0), OPT_FLAG("osd-bar", osd_bar_visible, UPDATE_OSD), diff --git a/options/options.h b/options/options.h index bc0f1b3e89..8fbec3161c 100644 --- a/options/options.h +++ b/options/options.h @@ -82,8 +82,6 @@ struct mp_subtitle_opts { float sub_scale; float sub_gauss; int sub_gray; - int sub_filter_SDH; - int sub_filter_SDH_harder; int ass_enabled; float ass_line_spacing; int ass_use_margins; @@ -102,6 +100,11 @@ struct mp_subtitle_opts { int teletext_page; }; +struct mp_sub_filter_opts { + int sub_filter_SDH; + int sub_filter_SDH_harder; +}; + struct mp_osd_render_opts { float osd_bar_align_x; float osd_bar_align_y; @@ -173,6 +176,7 @@ typedef struct MPOpts { char *audio_spdif; struct mp_subtitle_opts *subs_rend; + struct mp_sub_filter_opts *subs_filt; struct mp_osd_render_opts *osd_rend; int osd_level; @@ -361,6 +365,7 @@ struct filter_opts { extern const struct m_sub_options vo_sub_opts; extern const struct m_sub_options dvd_conf; extern const struct m_sub_options mp_subtitle_sub_opts; +extern const struct m_sub_options mp_sub_filter_opts; extern const struct m_sub_options mp_osd_render_sub_opts; extern const struct m_sub_options filter_conf; extern const struct m_sub_options resample_conf; |