From c7f450723ff3acfbea153e5cd2d73e5b016be539 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Feb 2015 21:10:08 +0100 Subject: player: allow unsetting --term/osd-playing-msg Treat an empty string as unset. The fact that the option values can be NULL is merely weirdness due to how the option parser works (it unfortunately doesn't initialize string fields to non-NULL). --- player/playloop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/player/playloop.c b/player/playloop.c index 9471664e10..44a29ce103 100644 --- a/player/playloop.c +++ b/player/playloop.c @@ -915,13 +915,13 @@ static void handle_playback_restart(struct MPContext *mpctx, double endpts) mpctx->restart_complete = true; mp_notify(mpctx, MPV_EVENT_PLAYBACK_RESTART, NULL); if (!mpctx->playing_msg_shown) { - if (opts->playing_msg) { + if (opts->playing_msg && opts->playing_msg[0]) { 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) { + 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); -- cgit v1.2.3