From 4590ac20823815f1c0bff079f5eeae760af44819 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 23 Oct 2014 14:54:13 +0200 Subject: m_option: format mpv_node as json Useful for debugging and informational purposes. Not sure if it's sane in any form. --- options/m_option.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3