diff options
author | wm4 <wm4@nowhere> | 2015-02-18 21:10:08 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-18 21:12:57 +0100 |
commit | c7f450723ff3acfbea153e5cd2d73e5b016be539 (patch) | |
tree | 9c2c79175fb124d0324324e365c58d519b203ee4 | |
parent | ff992e093b93fd8dd0eecd2c592f8608870f0bbe (diff) | |
download | mpv-c7f450723ff3acfbea153e5cd2d73e5b016be539.tar.bz2 mpv-c7f450723ff3acfbea153e5cd2d73e5b016be539.tar.xz |
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).
-rw-r--r-- | player/playloop.c | 4 |
1 files 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); |