mirror of
https://github.com/mpv-player/mpv
synced 2025-01-08 16:10:29 +00:00
m_option: format mpv_node as json
Useful for debugging and informational purposes. Not sure if it's sane in any form.
This commit is contained in:
parent
dd77f0d37e
commit
4590ac2082
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user