summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-15 13:20:05 +0200
committerwm4 <wm4@nowhere>2016-04-15 13:20:05 +0200
commitfbb5da0010345f7d26a7ffda70d0cc774e3b7c9f (patch)
tree7bcb6dd855e1d16ef72e3256c911179aebce6ad9
parent177f5d9e9cd0f053437789121f774596cae76f41 (diff)
downloadmpv-fbb5da0010345f7d26a7ffda70d0cc774e3b7c9f.tar.bz2
mpv-fbb5da0010345f7d26a7ffda70d0cc774e3b7c9f.tar.xz
command: log property set calls
And remove the same thing from the client API code. The command.c code has to deal with many specialized M_PROPERTY_SET_* actions, and we bother with a subset only.
-rw-r--r--player/client.c8
-rw-r--r--player/command.c17
2 files changed, 17 insertions, 8 deletions
diff --git a/player/client.c b/player/client.c
index 6b5eaf7883..45bd2297ba 100644
--- a/player/client.c
+++ b/player/client.c
@@ -1085,14 +1085,6 @@ static void setproperty_fn(void *arg)
req->status = translate_property_error(err);
- if (mp_msg_test(req->mpctx->log, MSGL_V)) {
- struct m_option ot = {.type = &m_option_type_node};
- char *t = m_option_print(&ot, node);
- MP_VERBOSE(req->mpctx, "Set property: %s=%s -> %d\n",
- req->name, t ? t : "?", err);
- talloc_free(t);
- }
-
if (req->reply_ctx) {
status_reply(req->reply_ctx, MPV_EVENT_SET_PROPERTY_REPLY,
req->userdata, req->status);
diff --git a/player/command.c b/player/command.c
index a0cf56db68..e3a3313f79 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3904,6 +3904,23 @@ int mp_property_do(const char *name, int action, void *val,
int r = m_property_do(ctx->log, mp_properties, name, action, val, ctx);
if (r == M_PROPERTY_OK && is_property_set(action, val))
mp_notify_property(ctx, (char *)name);
+ if (mp_msg_test(ctx->log, MSGL_V) && is_property_set(action, val)) {
+ struct m_option ot = {0};
+ void *data = val;
+ switch (action) {
+ case M_PROPERTY_SET_NODE:
+ ot.type = &m_option_type_node;
+ break;
+ case M_PROPERTY_SET_STRING:
+ ot.type = &m_option_type_string;
+ data = &val;
+ break;
+ }
+ char *t = ot.type ? m_option_print(&ot, data) : NULL;
+ MP_VERBOSE(ctx, "Set property: %s%s%s -> %d\n",
+ name, t ? "=" : "", t ? t : "", r);
+ talloc_free(t);
+ }
return r;
}