summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-13 22:22:53 +0200
committerwm4 <wm4@nowhere>2016-04-13 22:22:53 +0200
commit9a4120f21f316d95d7788cbf71fe36abbb2e279e (patch)
treef67241b664b492a54d1cee797c6f66d21829683f /options/m_option.c
parente3e03d0f34de86085d18f92a3dceab337c3220b6 (diff)
downloadmpv-9a4120f21f316d95d7788cbf71fe36abbb2e279e.tar.bz2
mpv-9a4120f21f316d95d7788cbf71fe36abbb2e279e.tar.xz
m_option: add string conversion for --audio-channels
Requested in #3040.
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c8
1 files changed, 8 insertions, 0 deletions
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,
};