mirror of https://github.com/mpv-player/mpv
osd: add --osd-status-msg option for custom OSD status
This commit is contained in:
parent
bd835cdeea
commit
6b3e7740f1
|
@ -1404,6 +1404,12 @@
|
|||
|
||||
Default: 0.
|
||||
|
||||
--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``), or in some
|
||||
non-default cases when seeking. Expands properties. See ``--playing-msg``.
|
||||
|
||||
--overlapsub
|
||||
Allows the next subtitle to be displayed while the current one is still
|
||||
visible (default is to enable the support only for specific formats). This
|
||||
|
|
|
@ -678,6 +678,7 @@ const m_option_t mplayer_opts[]={
|
|||
OPT_STRING("term-osd-esc", term_osd_esc, 0, OPTDEF_STR("\x1b[A\r\x1b[K")),
|
||||
OPT_STRING("playing-msg", playing_msg, 0),
|
||||
OPT_STRING("status-msg", status_msg, 0),
|
||||
OPT_STRING("osd-status-msg", osd_status_msg, 0),
|
||||
|
||||
{"slave-broken", &slave_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL},
|
||||
OPT_FLAG("idle", player_idle_mode, CONF_GLOBAL),
|
||||
|
|
|
@ -1437,6 +1437,12 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
|
|||
}
|
||||
}
|
||||
saddf_osd_function_sym(buffer, sym);
|
||||
char *custom_msg = mpctx->opts.osd_status_msg;
|
||||
if (custom_msg && full) {
|
||||
char *text = mp_property_expand_string(mpctx, custom_msg);
|
||||
*buffer = talloc_strdup_append(*buffer, text);
|
||||
talloc_free(text);
|
||||
} else {
|
||||
sadd_hhmmssff(buffer, get_current_time(mpctx), fractions);
|
||||
if (full) {
|
||||
saddf(buffer, " / ");
|
||||
|
@ -1444,6 +1450,7 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
|
|||
sadd_percentage(buffer, get_percent_pos(mpctx));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// OSD messages initated by seeking commands are added lazily with this
|
||||
// function, because multiple successive seek commands can be coalesced.
|
||||
|
|
|
@ -77,6 +77,7 @@ typedef struct MPOpts {
|
|||
char *term_osd_esc;
|
||||
char *playing_msg;
|
||||
char *status_msg;
|
||||
char *osd_status_msg;
|
||||
int player_idle_mode;
|
||||
int consolecontrols;
|
||||
int doubleclick_time;
|
||||
|
|
Loading…
Reference in New Issue