mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
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.
This commit is contained in:
parent
20988ee607
commit
f312528ebc
@ -2401,11 +2401,11 @@ 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",
|
||||
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,11 +2424,11 @@ 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",
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user