mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 04:42:10 +00:00
command: add --osd-on-seek option defaulting to bar
Restores behaviour prior to aef2ed5dc1
.
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.
This commit is contained in:
parent
8c8dcc698b
commit
3766024dcd
@ -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
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user