From b799bf0dbf0382cb79727cbc4bf9e1ee0a6e6a1d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 13 Sep 2014 16:52:42 +0200 Subject: client API: use playback abort mechanism If you send the "quit" or "stop" command with the client API, it will now attempt to kill network I/O immediately (same as normal input in the previous commits). --- player/client.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'player') diff --git a/player/client.c b/player/client.c index 41f7e12289..b9ad7d47c4 100644 --- a/player/client.c +++ b/player/client.c @@ -23,6 +23,7 @@ #include "common/msg.h" #include "common/msg_control.h" #include "input/input.h" +#include "input/cmd_list.h" #include "misc/dispatch.h" #include "options/m_config.h" #include "options/m_option.h" @@ -32,6 +33,7 @@ #include "osdep/threads.h" #include "osdep/timer.h" #include "osdep/io.h" +#include "stream/stream.h" #include "command.h" #include "core.h" @@ -857,6 +859,9 @@ static int run_client_command(mpv_handle *ctx, struct mp_cmd *cmd) if (!cmd) return MPV_ERROR_INVALID_PARAMETER; + if (mp_input_is_abort_cmd(cmd)) + mp_cancel_trigger(ctx->mpctx->playback_abort); + struct cmd_request req = { .mpctx = ctx->mpctx, .cmd = cmd, -- cgit v1.2.3