summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-09-13 16:52:42 +0200
committerwm4 <wm4@nowhere>2014-09-13 16:52:42 +0200
commitb799bf0dbf0382cb79727cbc4bf9e1ee0a6e6a1d (patch)
treedb99d4aca36307861bbbe36c4964cd55f771744b
parent893f4a0feebde98247141855700173011bdeb353 (diff)
downloadmpv-b799bf0dbf0382cb79727cbc4bf9e1ee0a6e6a1d.tar.bz2
mpv-b799bf0dbf0382cb79727cbc4bf9e1ee0a6e6a1d.tar.xz
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).
-rw-r--r--player/client.c5
1 files changed, 5 insertions, 0 deletions
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,