From 9a4120f21f316d95d7788cbf71fe36abbb2e279e Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 13 Apr 2016 22:22:53 +0200 Subject: [PATCH] m_option: add string conversion for --audio-channels Requested in #3040. --- options/m_option.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/options/m_option.c b/options/m_option.c index 9f2d8758d0..5b07ba5d2a 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2287,10 +2287,18 @@ static int parse_chmap(struct mp_log *log, const m_option_t *opt, return 1; } +static char *print_chmap(const m_option_t *opt, const void *val) +{ + const struct mp_chmap *chmap = val; + return talloc_strdup(NULL, mp_chmap_to_str(chmap)); +} + + const m_option_type_t m_option_type_chmap = { .name = "Audio channels or channel map", .size = sizeof(struct mp_chmap), .parse = parse_chmap, + .print = print_chmap, .copy = copy_opt, };