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
156 Undo one ``suspend`` call. ``suspend`` increments an internal counter, and156 Undo one ``suspend`` call. ``suspend`` increments an internal counter, and
157 ``resume`` decrements it. When 0 is reached, the player is actually resumed.157 ``resume`` decrements it. When 0 is reached, the player is actually resumed.
158 158
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
159UTF-8163UTF-8
160-----164-----
161 165
input/ipc.c+4−0
@@ -287,6 +287,10 @@ static char *json_execute_command(struct client_arg *arg, void *ta_parent, · 286 unmodified lines
287 int64_t time_us = mpv_get_time_us(arg->client);287 int64_t time_us = mpv_get_time_us(arg->client);
288 mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);288 mpv_node_map_add_int64(ta_parent, &reply_node, "data", time_us);
289 rc = MPV_ERROR_SUCCESS;289 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;
290 } else if (!strcmp("get_property", cmd)) {294 } else if (!strcmp("get_property", cmd)) {
291 mpv_node result_node;295 mpv_node result_node;
292 296

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