mirror of https://github.com/mpv-player/mpv
ipc: add a command to retrieve API version
This commit is contained in:
parent
a1e7daf942
commit
de59b87609
|
@ -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
|
Undo one ``suspend`` call. ``suspend`` increments an internal counter, and
|
||||||
``resume`` decrements it. When 0 is reached, the player is actually resumed.
|
``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
|
UTF-8
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -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);
|
int64_t time_us = mpv_get_time_us(arg->client);
|
||||||
mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);
|
mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);
|
||||||
rc = MPV_ERROR_SUCCESS;
|
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)) {
|
} else if (!strcmp("get_property", cmd)) {
|
||||||
mpv_node result_node;
|
mpv_node result_node;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue