diff options
author | Guido Cella <guido@guidocella.xyz> | 2022-04-08 00:00:00 +0200 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-04-07 22:13:50 +0000 |
commit | d6affda0a7b4b6b4b35a833820e7e98fd88b6c52 (patch) | |
tree | b347067754d9cab1be8fea3010ca9cf0a0b7c8c2 | |
parent | 86dfdf083bf4f5b4bb074e850e85a3b133210d38 (diff) | |
download | mpv-d6affda0a7b4b6b4b35a833820e7e98fd88b6c52.tar.bz2 mpv-d6affda0a7b4b6b4b35a833820e7e98fd88b6c52.tar.xz |
options: add osd-playing-msg-duration
-rw-r--r-- | DOCS/man/options.rst | 4 | ||||
-rw-r--r-- | options/options.c | 2 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | player/playloop.c | 4 |
4 files changed, 10 insertions, 1 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 85ab159f83..f895fe2ecc 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4062,6 +4062,10 @@ OSD See `Property Expansion`_. +``--osd-playing-msg-duration=<time>`` + Set the duration of ``osd-playing-msg`` in ms. If this is unset, + ``osd-playing-msg`` stays on screen for the duration of ``osd-duration``. + ``--osd-bar-align-x=<-1-1>`` Position of the OSD bar. -1 is far left, 0 is centered, 1 is far right. Fractional values (like 0.5) are allowed. diff --git a/options/options.c b/options/options.c index 64d7f9146e..a8463e29c0 100644 --- a/options/options.c +++ b/options/options.c @@ -748,6 +748,8 @@ static const m_option_t mp_opts[] = { {"term-playing-msg", OPT_STRING(playing_msg)}, {"osd-playing-msg", OPT_STRING(osd_playing_msg)}, + {"osd-playing-msg-duration", OPT_INT(osd_playing_msg_duration), + M_RANGE(0, 3600000)}, {"term-status-msg", OPT_STRING(status_msg), .flags = UPDATE_OSD}, {"osd-status-msg", OPT_STRING(osd_status_msg), .flags = UPDATE_OSD}, {"osd-msg1", OPT_STRING(osd_msg[0]), .flags = UPDATE_OSD}, diff --git a/options/options.h b/options/options.h index 53e8de7852..fd04ebdfa0 100644 --- a/options/options.h +++ b/options/options.h @@ -233,6 +233,7 @@ typedef struct MPOpts { char *term_title; char *playing_msg; char *osd_playing_msg; + int osd_playing_msg_duration; char *status_msg; char *osd_status_msg; char *osd_msg[3]; diff --git a/player/playloop.c b/player/playloop.c index 093c135878..c0db53f294 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -1139,7 +1139,9 @@ static void handle_playback_restart(struct MPContext *mpctx) if (opts->osd_playing_msg && opts->osd_playing_msg[0]) { char *msg = mp_property_expand_escaped_string(mpctx, opts->osd_playing_msg); - set_osd_msg(mpctx, 1, opts->osd_duration, "%s", msg); + set_osd_msg(mpctx, 1, opts->osd_playing_msg_duration ? + opts->osd_playing_msg_duration : opts->osd_duration, + "%s", msg); talloc_free(msg); } } |