summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-10 01:48:18 +0100
committerwm4 <wm4@nowhere>2014-03-10 01:48:18 +0100
commit378a15564c1203aea0c3076581c666863228c7f2 (patch)
tree7334ba19739ac7d87eecb0bb81a9d8218a653df8 /options
parentb3f9d3750b8e1e627008758181aa98a6c788e7cd (diff)
downloadmpv-378a15564c1203aea0c3076581c666863228c7f2.tar.bz2
mpv-378a15564c1203aea0c3076581c666863228c7f2.tar.xz
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.
Diffstat (limited to 'options')
-rw-r--r--options/m_option.c4
1 files changed, 2 insertions, 2 deletions
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;