From 5ab11016c8961878ab09c8691335ae38bc7c4044 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 9 Jan 2017 13:39:38 +0100 Subject: command: remove worthless error handling code The property calls will always succeed anyway. On the other hand, the error handling is kind of incomplete (doesn't check setting ab-loop-a when ab-loop-b is also set), so drop this code. --- player/command.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/player/command.c b/player/command.c index 48a23b7719..1beca6158a 100644 --- a/player/command.c +++ b/player/command.c @@ -5308,20 +5308,19 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re case MP_CMD_AB_LOOP: { double now = get_current_time(mpctx); - int r = 0; if (opts->ab_loop[0] == MP_NOPTS_VALUE) { - r = mp_property_do("ab-loop-a", M_PROPERTY_SET, &now, mpctx); + mp_property_do("ab-loop-a", M_PROPERTY_SET, &now, mpctx); show_property_osd(mpctx, "ab-loop-a", on_osd); } else if (opts->ab_loop[1] == MP_NOPTS_VALUE) { - r = mp_property_do("ab-loop-b", M_PROPERTY_SET, &now, mpctx); + mp_property_do("ab-loop-b", M_PROPERTY_SET, &now, mpctx); show_property_osd(mpctx, "ab-loop-b", on_osd); } else { now = MP_NOPTS_VALUE; - r = mp_property_do("ab-loop-a", M_PROPERTY_SET, &now, mpctx); - r = mp_property_do("ab-loop-b", M_PROPERTY_SET, &now, mpctx); + mp_property_do("ab-loop-a", M_PROPERTY_SET, &now, mpctx); + mp_property_do("ab-loop-b", M_PROPERTY_SET, &now, mpctx); set_osd_msg(mpctx, osdl, osd_duration, "Clear A-B loop"); } - return r > 0; + break; } case MP_CMD_DROP_BUFFERS: { -- cgit v1.2.3