0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

m_option: add string conversion for --audio-channels

Requested in #3040.
This commit is contained in:
wm4 2016-04-13 22:22:53 +02:00
parent e3e03d0f34
commit 9a4120f21f

View File

@ -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,
};