From 55624a70eeac79d6a5a208a078458f1fe07b833a Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Jun 2015 19:21:01 +0200 Subject: [PATCH] chmap_sel: do naive speaker replacements last This prevents that the potentially better pick by mp_chmap_sel_fallback() is overridden. --- audio/chmap_sel.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index 3d93a11a5c..855d0dc683 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -176,6 +176,10 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map) return true; } } + + if (mp_chmap_sel_fallback(s, map)) + return true; + for (int i = 0; i < MP_ARRAY_SIZE(speaker_replacements); i++) { struct mp_chmap t = *map; struct mp_chmap *r = (struct mp_chmap *)speaker_replacements[i]; @@ -185,9 +189,6 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map) } } - if (mp_chmap_sel_fallback(s, map)) - return true; - // Fallback to mono/stereo as last resort *map = (struct mp_chmap) MP_CHMAP_INIT_STEREO; if (test_layout(s, map))