History

ipc: add a command to retrieve API version

wm4 committed 12 years ago

Commit de59b871 parent a1e7daf2 files · +8 −0Browse files

Unified · Split

2 files
  1. DOCS/man/ipc.rst +4 −0
  2. input/ipc.c +4 −0
DOCS/man/ipc.rst+4−0
@@ -156,6 +156,10 @@ extra commands can also be used as part of the protocol: · 155 unmodified lines
156156 Undo one ``suspend`` call. ``suspend`` increments an internal counter, and
157157 ``resume`` decrements it. When 0 is reached, the player is actually resumed.
158158
159+``get_version``
160+ Returns the client API version the C API of the remote mpv instance
161+ provides. (Also see ``DOCS/client-api-changes.rst``.)
162+
159163 UTF-8
160164 -----
161165
input/ipc.c+4−0
@@ -287,6 +287,10 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent, · 286 unmodified lines
287287 int64_t time_us = mpv_get_time_us(arg->client);
288288 mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);
289289 rc = MPV_ERROR_SUCCESS;
290+ } else if (!strcmp("get_version", cmd)) {
291+ int64_t ver = mpv_client_api_version();
292+ mpv_node_map_add_int64(ta_parent, &reply_node, "data", ver);
293+ rc = MPV_ERROR_SUCCESS;
290294 } else if (!strcmp("get_property", cmd)) {
291295 mpv_node result_node;
292296

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t