summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/options.rst6
-rw-r--r--core/cfg-mplayer.h1
-rw-r--r--core/mplayer.c17
-rw-r--r--core/options.h1
4 files changed, 20 insertions, 5 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index 46999b9ed8..b1d630f68e 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -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
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h
index 6de9b7e65c..a0b3f95f42 100644
--- a/core/cfg-mplayer.h
+++ b/core/cfg-mplayer.h
@@ -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),
diff --git a/core/mplayer.c b/core/mplayer.c
index 9eb81115fc..e873410aa5 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -1437,11 +1437,18 @@ static void sadd_osd_status(char **buffer, struct MPContext *mpctx, bool full)
}
}
saddf_osd_function_sym(buffer, sym);
- sadd_hhmmssff(buffer, get_current_time(mpctx), fractions);
- if (full) {
- saddf(buffer, " / ");
- sadd_hhmmssff(buffer, get_time_length(mpctx), fractions);
- sadd_percentage(buffer, get_percent_pos(mpctx));
+ 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, " / ");
+ sadd_hhmmssff(buffer, get_time_length(mpctx), fractions);
+ sadd_percentage(buffer, get_percent_pos(mpctx));
+ }
}
}
diff --git a/core/options.h b/core/options.h
index 94842cbc53..3d4e014c6e 100644
--- a/core/options.h
+++ b/core/options.h
@@ -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;