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).
This commit is contained in:
wm4 2015-02-18 21:10:08 +01:00
parent ff992e093b
commit c7f450723f
1 changed files with 2 additions and 2 deletions

View File

@ -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);