mirror of
https://github.com/mpv-player/mpv
synced 2025-03-02 04:11:03 +00:00
client API: print properties set with -v
Useful for debugging. Considered doing this in command.c, but it's easier here.
This commit is contained in:
parent
4590ac2082
commit
7cf18a8db9
@ -967,6 +967,7 @@ static void setproperty_fn(void *arg)
|
||||
// do this, because it tries to be somewhat type-strict. But the client
|
||||
// needs a way to set everything by string.
|
||||
char *s = *(char **)req->data;
|
||||
MP_VERBOSE(req->mpctx, "Set property string: %s='%s'\n", req->name, s);
|
||||
err = mp_property_do(req->name, M_PROPERTY_SET_STRING, s, req->mpctx);
|
||||
break;
|
||||
}
|
||||
@ -982,6 +983,12 @@ static void setproperty_fn(void *arg)
|
||||
node.format = req->format;
|
||||
memcpy(&node.u, req->data, type->type->size);
|
||||
}
|
||||
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\n", req->name, t ? t : "?");
|
||||
talloc_free(t);
|
||||
}
|
||||
err = mp_property_do(req->name, M_PROPERTY_SET_NODE, &node, req->mpctx);
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user