diff options
author | wm4 <wm4@nowhere> | 2017-01-09 13:39:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-09 13:39:38 +0100 |
commit | 5ab11016c8961878ab09c8691335ae38bc7c4044 (patch) | |
tree | a57268ee10ff3fa8cdab8972a101d91cfd102ec4 /player/command.c | |
parent | 0ae753bc3d6330d23dfd7bb30a5c998e34943e93 (diff) | |
download | mpv-5ab11016c8961878ab09c8691335ae38bc7c4044.tar.bz2 mpv-5ab11016c8961878ab09c8691335ae38bc7c4044.tar.xz |
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.
Diffstat (limited to 'player/command.c')
-rw-r--r-- | player/command.c | 11 |
1 files 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: { |