From 378a15564c1203aea0c3076581c666863228c7f2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 10 Mar 2014 01:48:18 +0100 Subject: m_option: fix handling of empty channel layouts Even if a channel map option signaled that empty layouts are accepted, the option parser never actually accepted them. --- options/m_option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'options') diff --git a/options/m_option.c b/options/m_option.c index 42d02bfc61..9bf2ebd132 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2044,8 +2044,8 @@ static int parse_chmap(struct mp_log *log, const m_option_t *opt, return M_OPT_INVALID; } - if ((min_ch > 0 && !mp_chmap_is_valid(&res)) || - (min_ch >= 0 && mp_chmap_is_empty(&res))) + if ((min_ch >= 0 && !mp_chmap_is_valid(&res)) && + !(min_ch == 0 && mp_chmap_is_empty(&res))) { mp_err(log, "Invalid channel layout: %.*s\n", BSTR_P(param)); return M_OPT_INVALID; -- cgit v1.2.3