summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/ipc.rst4
-rw-r--r--input/ipc.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/DOCS/man/ipc.rst b/DOCS/man/ipc.rst
index 3d0be74423..2b5b3d2156 100644
--- a/DOCS/man/ipc.rst
+++ b/DOCS/man/ipc.rst
@@ -156,6 +156,10 @@ extra commands can also be used as part of the protocol:
Undo one ``suspend`` call. ``suspend`` increments an internal counter, and
``resume`` decrements it. When 0 is reached, the player is actually resumed.
+``get_version``
+ Returns the client API version the C API of the remote mpv instance
+ provides. (Also see ``DOCS/client-api-changes.rst``.)
+
UTF-8
-----
diff --git a/input/ipc.c b/input/ipc.c
index 1fb096842b..548bb3fe39 100644
--- a/input/ipc.c
+++ b/input/ipc.c
@@ -287,6 +287,10 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent,
int64_t time_us = mpv_get_time_us(arg->client);
mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);
rc = MPV_ERROR_SUCCESS;
+ } else if (!strcmp("get_version", cmd)) {
+ int64_t ver = mpv_client_api_version();
+ mpv_node_map_add_int64(ta_parent, &reply_node, "data", ver);
+ rc = MPV_ERROR_SUCCESS;
} else if (!strcmp("get_property", cmd)) {
mpv_node result_node;