From 2da246b9f715a5694263b1ed3dee30b2001b6ed4 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 2 Sep 2014 00:09:03 +0200 Subject: player: add --osd-playing-msg option --- player/playloop.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'player') diff --git a/player/playloop.c b/player/playloop.c index a53c2c4b96..0e35dcb88b 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -871,11 +871,19 @@ void run_playloop(struct MPContext *mpctx) mpctx->hrseek_active = false; mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); mpctx->restart_complete = true; - if (opts->playing_msg && !mpctx->playing_msg_shown) { - char *msg = - mp_property_expand_escaped_string(mpctx, opts->playing_msg); - MP_INFO(mpctx, "%s\n", msg); - talloc_free(msg); + if (!mpctx->playing_msg_shown) { + if (opts->playing_msg) { + char *msg = + mp_property_expand_escaped_string(mpctx, opts->playing_msg); + MP_INFO(mpctx, "%s\n", msg); + talloc_free(msg); + } + if (opts->osd_playing_msg) { + char *msg = + mp_property_expand_escaped_string(mpctx, opts->osd_playing_msg); + set_osd_msg(mpctx, 1, opts->osd_duration, "%s", msg); + talloc_free(msg); + } } mpctx->playing_msg_shown = true; } -- cgit v1.2.3