summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-27 23:21:14 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-28 08:34:36 +0900
commitcb2461044b1273919298860e0fedc41c4051b827 (patch)
treec6d129f64bf419bb8f8b217a3b7bf5ba3f2fe141 /audio
parent1eb7db70d5583802898064e3c26b95298a17fc5a (diff)
downloadmpv-cb2461044b1273919298860e0fedc41c4051b827.tar.bz2
mpv-cb2461044b1273919298860e0fedc41c4051b827.tar.xz
audio: avoid downmixing in a certain special-case
As indicated by the added test. In this case, fallback and downmix have the same score, but fallback happens to give better results. So prefer fallback over downmix. (This is probably not a correct solution.) (cherry picked from commit d3c7fd9d7c971086a3d6fde5f6f1bc4ef0b2e904)
Diffstat (limited to 'audio')
-rw-r--r--audio/chmap_sel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c
index 515190e14d..b99f7bd834 100644
--- a/audio/chmap_sel.c
+++ b/audio/chmap_sel.c
@@ -200,8 +200,8 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map)
}
#define UPMIX_IDX 0
-#define DOWNMIX_IDX 1
-#define FALLBACK_IDX 2
+#define FALLBACK_IDX 1
+#define DOWNMIX_IDX 2
static bool test_fallbacks(struct mp_chmap *a, struct mp_chmap *b,
int best_diffs[2], struct mp_chmap best[2])
@@ -278,7 +278,7 @@ bool mp_chmap_sel_fallback(const struct mp_chmap_sel *s, struct mp_chmap *map)
}
}
- for (int i = UPMIX_IDX; i < MP_ARRAY_SIZE(best); i++) {
+ for (int i = 0; i < MP_ARRAY_SIZE(best); i++) {
if (best_diffs[i] < INT_MAX) {
*map = best[i];
return true;