summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-20 16:21:52 +0100
committerAlessandro Ghedini <alessandro@ghedini.me>2015-01-14 16:17:19 +0100
commit8def7ccb4f252b738f376e2a4ad66ca9c9f1955a (patch)
tree67f5b7acdec9cbe52bc5bbf4a4fd6403db0ed59a
parentf88a86a936ce95ea87ed0514cad960a172c14e75 (diff)
downloadmpv-8def7ccb4f252b738f376e2a4ad66ca9c9f1955a.tar.bz2
mpv-8def7ccb4f252b738f376e2a4ad66ca9c9f1955a.tar.xz
audio: fix fallback if audio API does not support mono
This makes it fallback to stereo properly.
-rw-r--r--audio/chmap_sel.c11
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;