mirror of https://github.com/mpv-player/mpv
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:
parent
893f4a0fee
commit
b799bf0dbf
|
@ -23,6 +23,7 @@
|
||||||
#include "common/msg.h"
|
#include "common/msg.h"
|
||||||
#include "common/msg_control.h"
|
#include "common/msg_control.h"
|
||||||
#include "input/input.h"
|
#include "input/input.h"
|
||||||
|
#include "input/cmd_list.h"
|
||||||
#include "misc/dispatch.h"
|
#include "misc/dispatch.h"
|
||||||
#include "options/m_config.h"
|
#include "options/m_config.h"
|
||||||
#include "options/m_option.h"
|
#include "options/m_option.h"
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
#include "osdep/threads.h"
|
#include "osdep/threads.h"
|
||||||
#include "osdep/timer.h"
|
#include "osdep/timer.h"
|
||||||
#include "osdep/io.h"
|
#include "osdep/io.h"
|
||||||
|
#include "stream/stream.h"
|
||||||
|
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
|
@ -857,6 +859,9 @@ static int run_client_command(mpv_handle *ctx, struct mp_cmd *cmd)
|
||||||
if (!cmd)
|
if (!cmd)
|
||||||
return MPV_ERROR_INVALID_PARAMETER;
|
return MPV_ERROR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
if (mp_input_is_abort_cmd(cmd))
|
||||||
|
mp_cancel_trigger(ctx->mpctx->playback_abort);
|
||||||
|
|
||||||
struct cmd_request req = {
|
struct cmd_request req = {
|
||||||
.mpctx = ctx->mpctx,
|
.mpctx = ctx->mpctx,
|
||||||
.cmd = cmd,
|
.cmd = cmd,
|
||||||
|
|
Loading…
Reference in New Issue