From f312528ebc6980a55e61089f6d5e891fe0b18067 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 12 Oct 2013 18:42:42 +0200 Subject: [PATCH] command: preferably show "add"/"cycle"/"set" command errors on OSD Before this, they were shown on terminal only. Now they use the OSD mechanism, which shows them on the video window or the terminal, depending on settings and what's available. --- mpvcore/command.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mpvcore/command.c b/mpvcore/command.c index c9eb21dd0b..fdb507962f 100644 --- a/mpvcore/command.c +++ b/mpvcore/command.c @@ -2401,12 +2401,12 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (r == M_PROPERTY_OK || r == M_PROPERTY_UNAVAILABLE) { show_property_osd(mpctx, cmd->args[0].v.s, cmd->on_osd); } else if (r == M_PROPERTY_UNKNOWN) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Unknown property: '%s'\n", cmd->args[0].v.s); + set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, + "Unknown property: '%s'", cmd->args[0].v.s); } else if (r <= 0) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Failed to set property '%s' to '%s'.\n", - cmd->args[0].v.s, cmd->args[1].v.s); + set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, + "Failed to set property '%s' to '%s'", + cmd->args[0].v.s, cmd->args[1].v.s); } break; } @@ -2424,12 +2424,12 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (r == M_PROPERTY_OK || r == M_PROPERTY_UNAVAILABLE) { show_property_osd(mpctx, cmd->args[0].v.s, cmd->on_osd); } else if (r == M_PROPERTY_UNKNOWN) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Unknown property: '%s'\n", cmd->args[0].v.s); + set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, + "Unknown property: '%s'", cmd->args[0].v.s); } else if (r <= 0) { - mp_msg(MSGT_CPLAYER, MSGL_WARN, - "Failed to increment property '%s' by %g.\n", - cmd->args[0].v.s, s.inc); + set_osd_msg(mpctx, OSD_MSG_TEXT, osdl, osd_duration, + "Failed to increment property '%s' by %g", + cmd->args[0].v.s, s.inc); } break; }