diff options
author | wm4 <wm4@nowhere> | 2018-05-13 12:19:11 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2018-05-25 10:45:59 +0200 |
commit | 40ebedabcfbbff03319843692852e141161be785 (patch) | |
tree | 2c102295628ad8a55b6472a752f352c722136a6b /input/ipc.c | |
parent | 47ed894d19678c915a3185945b3f97baeeecafb4 (diff) | |
download | mpv-40ebedabcfbbff03319843692852e141161be785.tar.bz2 mpv-40ebedabcfbbff03319843692852e141161be785.tar.xz |
ipc: alias set_property_string to set_property
The only effective difference is that the former explicitly checks
whether the JSON value type is string, and errors out if not. The rest
is exactly the same (mpv_set_property_string is mpv_set_property with
MPV_FORMAT_STRING).
It seems silly to keep this, so just remove it.
Diffstat (limited to 'input/ipc.c')
-rw-r--r-- | input/ipc.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/input/ipc.c b/input/ipc.c index fc1e11b981..d87b495412 100644 --- a/input/ipc.c +++ b/input/ipc.c @@ -286,7 +286,9 @@ static char *json_execute_command(struct mpv_handle *client, void *ta_parent, mpv_node_map_add_string(ta_parent, &reply_node, "data", result); mpv_free(result); } - } else if (!strcmp("set_property", cmd)) { + } else if (!strcmp("set_property", cmd) || + !strcmp("set_property_string", cmd)) + { if (cmd_node->u.list->num != 3) { rc = MPV_ERROR_INVALID_PARAMETER; goto error; @@ -299,25 +301,6 @@ static char *json_execute_command(struct mpv_handle *client, void *ta_parent, rc = mpv_set_property(client, cmd_node->u.list->values[1].u.string, MPV_FORMAT_NODE, &cmd_node->u.list->values[2]); - } else if (!strcmp("set_property_string", cmd)) { - if (cmd_node->u.list->num != 3) { - rc = MPV_ERROR_INVALID_PARAMETER; - goto error; - } - - if (cmd_node->u.list->values[1].format != MPV_FORMAT_STRING) { - rc = MPV_ERROR_INVALID_PARAMETER; - goto error; - } - - if (cmd_node->u.list->values[2].format != MPV_FORMAT_STRING) { - rc = MPV_ERROR_INVALID_PARAMETER; - goto error; - } - - rc = mpv_set_property_string(client, - cmd_node->u.list->values[1].u.string, - cmd_node->u.list->values[2].u.string); } else if (!strcmp("observe_property", cmd)) { if (cmd_node->u.list->num != 3) { rc = MPV_ERROR_INVALID_PARAMETER; |