diff options
author | wm4 <wm4@nowhere> | 2019-12-27 17:44:33 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-12-27 17:44:33 +0100 |
commit | 0c0c373844d733c75ff3183a297a1a55c336f1a2 (patch) | |
tree | 9c130cc6fd426b708ab44e70fe48feb9f9c397ad /options | |
parent | 2a7e17fe4e2875d7a85262c2efe16bbdd797a890 (diff) | |
download | mpv-0c0c373844d733c75ff3183a297a1a55c336f1a2.tar.bz2 mpv-0c0c373844d733c75ff3183a297a1a55c336f1a2.tar.xz |
m_option: fix runtime changing of --audio-channels
This option type, used by --audio-channels, had a completely broken
m_option_type.equal implementation, and thus reacted incorrectly to
runtime option changes.
Broken since commit b16cea750f527088be7977.
Diffstat (limited to 'options')
-rw-r--r-- | options/m_option.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/options/m_option.c b/options/m_option.c index 46ebb4dba8..c55ca06bc8 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -2585,9 +2585,20 @@ static void copy_channels(const m_option_t *opt, void *dst, const void *src) static bool channels_equal(const m_option_t *opt, void *a, void *b) { - struct mp_chmap *ca = a; - struct mp_chmap *cb = b; - return mp_chmap_equals(ca, cb); + struct m_channels *ca = a; + struct m_channels *cb = b; + + if (ca->set != cb->set || + ca->auto_safe != cb->auto_safe || + ca->num_chmaps != cb->num_chmaps) + return false; + + for (int n = 0; n < ca->num_chmaps; n++) { + if (!mp_chmap_equals(&ca->chmaps[n], &cb->chmaps[n])) + return false; + } + + return true; } const m_option_type_t m_option_type_channels = { |