diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-21 15:36:08 -0800 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-01-26 21:50:38 -0800 |
commit | 3766024dcd85ec7b3bffdcf81cf1356d6fc82543 (patch) | |
tree | 464a329515afcc23579822e598804443677b39aa | |
parent | 8c8dcc698b394be4de5804313e8d8a7a4c094e2f (diff) | |
download | mpv-3766024dcd85ec7b3bffdcf81cf1356d6fc82543.tar.bz2 mpv-3766024dcd85ec7b3bffdcf81cf1356d6fc82543.tar.xz |
command: add --osd-on-seek option defaulting to bar
Restores behaviour prior to aef2ed5dc13e37dec0670c451b4369b151d5c65f.
That change was apparently unpopular. However, given the amount of
complaining over how hard it is to change the defaults by rebinding every
key, I think the extra option introduced by this commit is justified.
Technically not all behaviour is restored, because now --no-osd-bar will
not instead display the msg text on seek. I think that feature was a
little weird and is now easy enough to remedy with the --osd-on-seek
option.
-rw-r--r-- | DOCS/interface-changes.rst | 1 | ||||
-rw-r--r-- | DOCS/man/options.rst | 18 | ||||
-rw-r--r-- | options/options.c | 6 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | player/command.c | 15 |
5 files changed, 30 insertions, 11 deletions
diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index ce60e72f6d..2b36506920 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -35,6 +35,7 @@ Interface changes vf toggle commands and the filter enable/disable flag to customize it. - deprecate --af=lavrresample. Use the ``--audio-resample-...`` options to customize resampling, or the libavfilter ``--af=aresample`` filter. + - add --osd-on-seek --- mpv 0.28.0 --- - rename --hwdec=mediacodec option to mediacodec-copy, to reflect conventions followed by other hardware video decoding APIs diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 65fb3e3778..57e79806c8 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -3096,9 +3096,15 @@ OSD Disable display of the OSD bar. You can configure this on a per-command basis in input.conf using ``osd-`` - prefixes, see ``Input command prefixes``. If you want to disable the OSD + prefixes, see ``Input Command Prefixes``. If you want to disable the OSD completely, use ``--osd-level=0``. +``--osd-on-seek=<no,bar,msg,msg-bar>`` + Set what is displayed on the OSD during seeks. The default is ``bar``. + + You can configure this on a per-command basis in input.conf using ``osd-`` + prefixes, see ``Input Command Prefixes``. + ``--osd-duration=<time>`` Set the duration of the OSD messages in ms (default: 1000). @@ -3130,16 +3136,18 @@ OSD (default), then the playback time, duration, and some more information is shown. - This is also used for the ``show-progress`` command (by default mapped to - ``P``), and when seeking. + This is used for the ``show-progress`` command (by default mapped to ``P``), + and when seeking if enabled with ``--osd-on-seek`` or by ``osd-`` prefixes + in input.conf (see ``Input Command Prefixes``). ``--osd-status-msg`` is a legacy equivalent (but with a minor difference). ``--osd-status-msg=<string>`` Show a custom string during playback instead of the standard status text. This overrides the status text used for ``--osd-level=3``, when using the - ``show-progress`` command (by default mapped to ``P``), and when - seeking. Expands properties. See `Property Expansion`_. + ``show-progress`` command (by default mapped to ``P``), and when seeking if + enabled with ``--osd-on-seek`` or ``osd-`` prefixes in input.conf (see + ``Input Command Prefixes``). Expands properties. See `Property Expansion`_. This option has been replaced with ``--osd-msg3``. The only difference is that this option implicitly includes ``${osd-sym-cc}``. This option is diff --git a/options/options.c b/options/options.c index be27344a14..44a9571598 100644 --- a/options/options.c +++ b/options/options.c @@ -589,6 +589,11 @@ const m_option_t mp_opts[] = { OPT_FLAG("use-filedir-conf", use_filedir_conf, 0), OPT_CHOICE("osd-level", osd_level, 0, ({"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})), + OPT_CHOICE("osd-on-seek", osd_on_seek, 0, + ({"no", 0}, + {"bar", 1}, + {"msg", 2}, + {"msg-bar", 3})), OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000), OPT_FLAG("osd-fractions", osd_fractions, 0), @@ -878,6 +883,7 @@ const struct MPOpts mp_default_opts = { .cursor_autohide_delay = 1000, .video_osd = 1, .osd_level = 1, + .osd_on_seek = 1, .osd_duration = 1000, #if HAVE_LUA .lua_load_osc = 1, diff --git a/options/options.h b/options/options.h index 424a1c8f0e..97f01e21f9 100644 --- a/options/options.h +++ b/options/options.h @@ -183,6 +183,7 @@ typedef struct MPOpts { int osd_level; int osd_duration; int osd_fractions; + int osd_on_seek; int video_osd; int untimed; diff --git a/player/command.c b/player/command.c index 2da7834233..4c03c7579e 100644 --- a/player/command.c +++ b/player/command.c @@ -4804,6 +4804,9 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re bool auto_osd = on_osd == MP_ON_OSD_AUTO; bool msg_osd = auto_osd || (on_osd & MP_ON_OSD_MSG); bool bar_osd = auto_osd || (on_osd & MP_ON_OSD_BAR); + bool seek_msg_osd = auto_osd ? opts->osd_on_seek & 2 : msg_osd; + bool seek_bar_osd = auto_osd ? opts->osd_on_seek & 1 : bar_osd; + int osdl = msg_osd ? 1 : OSD_LEVEL_INVISIBLE; bool async = cmd->flags & MP_ASYNC_CMD; @@ -4867,9 +4870,9 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re set_osd_function(mpctx, v > 0 ? OSD_FFW : OSD_REW); break; }} - if (bar_osd) + if (seek_bar_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_BAR; - if (msg_osd) + if (seek_msg_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_TEXT; break; } @@ -4888,9 +4891,9 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re queue_seek(mpctx, MPSEEK_ABSOLUTE, oldpts, MPSEEK_EXACT, MPSEEK_FLAG_DELAY); set_osd_function(mpctx, OSD_REW); - if (bar_osd) + if (seek_bar_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_BAR; - if (msg_osd) + if (seek_msg_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_TEXT; } else { return -1; @@ -5119,9 +5122,9 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re queue_seek(mpctx, MPSEEK_ABSOLUTE, a[0], MPSEEK_EXACT, MPSEEK_FLAG_DELAY); set_osd_function(mpctx, (a[0] > refpts) ? OSD_FFW : OSD_REW); - if (bar_osd) + if (seek_bar_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_BAR; - if (msg_osd) + if (seek_msg_osd) mpctx->add_osd_seek_info |= OSD_SEEK_INFO_TEXT; } } |