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.
This commit is contained in:
wm4 2014-03-10 01:48:18 +01:00
parent b3f9d3750b
commit 378a15564c
1 changed files with 2 additions and 2 deletions

View File

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