From fd02f0f4d88371c728aff3b4487974118ba4d014 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 29 Apr 2013 01:39:50 +0200 Subject: options: add --no-sub-visibility for symmetry Not really useful, but for symmetry with the sub-visibility property (mapped to the 'v' key by default). --- DOCS/man/en/options.rst | 5 ++++- core/cfg-mplayer.h | 1 + core/command.c | 25 +------------------------ 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst index d98fe960e6..a609e5f472 100644 --- a/DOCS/man/en/options.rst +++ b/DOCS/man/en/options.rst @@ -1284,7 +1284,10 @@ See ``quit_watch_later`` input command. --no-sub - Disables display of internal and external subtitles. + Don't select any subtitle when the file is loaded. + +--no-sub-visibility + Disable display of subtitles, but still select and decode them. --no-video Do not play video. With some demuxers this may not work. In those cases diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h index 5a2c32e0d0..529972766b 100644 --- a/core/cfg-mplayer.h +++ b/core/cfg-mplayer.h @@ -476,6 +476,7 @@ const m_option_t common_opts[] = { {"sub-delay", &sub_delay, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, {"subfps", &sub_fps, CONF_TYPE_FLOAT, 0, 0.0, 10.0, NULL}, OPT_FLAG("autosub", sub_auto, 0), + OPT_FLAG("sub-visibility", sub_visibility, 0), OPT_FLAG("sub-forced-only", forced_subs_only, 0), // enable Closed Captioning display {"overlapsub", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 2, NULL}, diff --git a/core/command.c b/core/command.c index 4e82ceccd8..5fa914fdf7 100644 --- a/core/command.c +++ b/core/command.c @@ -1294,28 +1294,6 @@ static int mp_property_sub_pos(m_option_t *prop, int action, void *arg, return property_osd_helper(prop, action, arg, mpctx); } -/// Subtitle visibility (RW) -static int mp_property_sub_visibility(m_option_t *prop, int action, - void *arg, MPContext *mpctx) -{ - struct MPOpts *opts = &mpctx->opts; - - if (!mpctx->sh_video) - return M_PROPERTY_UNAVAILABLE; - - switch (action) { - case M_PROPERTY_SET: - opts->sub_visibility = *(int *)arg; - osd_changed_all(mpctx->osd); - return M_PROPERTY_OK; - case M_PROPERTY_GET: - *(int *)arg = opts->sub_visibility; - return M_PROPERTY_OK; - } - return M_PROPERTY_NOT_IMPLEMENTED; -} - - #ifdef CONFIG_TV static tvi_handle_t *get_tvh(struct MPContext *mpctx) @@ -1493,8 +1471,7 @@ static const m_option_t mp_properties[] = { M_OPTION_PROPERTY_CUSTOM("sid", mp_property_sub), M_OPTION_PROPERTY_CUSTOM("sub-delay", mp_property_sub_delay), M_OPTION_PROPERTY_CUSTOM("sub-pos", mp_property_sub_pos), - { "sub-visibility", mp_property_sub_visibility, CONF_TYPE_FLAG, - M_OPT_RANGE, 0, 1, NULL }, + M_OPTION_PROPERTY_CUSTOM("sub-visibility", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-forced-only", property_osd_helper), M_OPTION_PROPERTY_CUSTOM("sub-scale", property_osd_helper), #ifdef CONFIG_ASS -- cgit v1.2.3