diff options
author | wm4 <wm4@nowhere> | 2014-10-23 14:54:13 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-23 15:13:05 +0200 |
commit | 4590ac20823815f1c0bff079f5eeae760af44819 (patch) | |
tree | 19361bf93a79225ca8c1c992def5ec09c0d1fee6 | |
parent | dd77f0d37e6b1f73c68bd6155356590477289422 (diff) | |
download | mpv-4590ac20823815f1c0bff079f5eeae760af44819.tar.bz2 mpv-4590ac20823815f1c0bff079f5eeae760af44819.tar.xz |
m_option: format mpv_node as json
Useful for debugging and informational purposes. Not sure if it's sane
in any form.
-rw-r--r-- | options/m_option.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/options/m_option.c b/options/m_option.c index 52a222e87e..37186d01cc 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -41,6 +41,7 @@ #include "common/common.h" #include "common/msg.h" #include "common/msg_control.h" +#include "misc/json.h" #include "m_option.h" #include "m_config.h" @@ -3041,7 +3042,12 @@ static int parse_node(struct mp_log *log, const m_option_t *opt, static char *print_node(const m_option_t *opt, const void *val) { - return NULL; + char *t = talloc_strdup(NULL, ""); + if (json_write(&t, &VAL(val)) < 0) { + talloc_free(t); + t = NULL; + } + return t; } static void dup_node(void *ta_parent, struct mpv_node *node) |