1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

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).
This commit is contained in:
wm4 2014-09-13 16:52:42 +02:00
parent 893f4a0fee
commit b799bf0dbf

View File

@ -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,