diff options
author | wm4 <wm4@nowhere> | 2014-12-20 16:21:52 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-20 16:21:52 +0100 |
commit | d07c6566cd8e6fa01be7e8a1bd2e0334fee5e7df (patch) | |
tree | ac53a86512cdea66de4165a9a1a4349a07942808 /audio | |
parent | e80d233fd41619bdaf032bf101262ef63ad3c215 (diff) | |
download | mpv-d07c6566cd8e6fa01be7e8a1bd2e0334fee5e7df.tar.bz2 mpv-d07c6566cd8e6fa01be7e8a1bd2e0334fee5e7df.tar.xz |
audio: fix fallback if audio API does not support mono
This makes it fallback to stereo properly.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/chmap_sel.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index 81354422d9..1c5b7919eb 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -184,12 +184,11 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map) } } // Fallback to mono/stereo as last resort - if (map->num == 1) { - *map = (struct mp_chmap) MP_CHMAP_INIT_MONO; - } else if (map->num >= 2) { - *map = (struct mp_chmap) MP_CHMAP_INIT_STEREO; - } - if (test_layout(s, map)) + *map = (struct mp_chmap) MP_CHMAP_INIT_MONO; + if (map->num == 1 && test_layout(s, map)) + return true; + *map = (struct mp_chmap) MP_CHMAP_INIT_STEREO; + if (map->num >= 2 && test_layout(s, map)) return true; *map = (struct mp_chmap) {0}; return false; |