summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-10 23:29:31 +0200
committerwm4 <wm4@nowhere>2015-09-10 23:29:31 +0200
commite45f4692804f48c7e8b4a4229bbd51d72a6a6d42 (patch)
treea8f512bab2f4dd67f7805739bc7139608382e1d2 /audio
parentdc04541ba8cf52aab24c8e55d0e640d79ba6605e (diff)
downloadmpv-e45f4692804f48c7e8b4a4229bbd51d72a6a6d42.tar.bz2
mpv-e45f4692804f48c7e8b4a4229bbd51d72a6a6d42.tar.xz
audio/format: fix interlaved vs. non-interleaved conversions
This mixed up the returned score for some interleaved/non-interleaved comparisons. Changing interleaving subtracted 1 point, while extending sample size by 1 byte also subtracted 1 point. (This scoring system is not ideal - it'd be much cleaner to do a 3-way sample format comparison instead, and sort the formats according to the comparison instead of the score.)
Diffstat (limited to 'audio')
-rw-r--r--audio/format.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/format.c b/audio/format.c
index 2817462f8e..ee9d2a1909 100644
--- a/audio/format.c
+++ b/audio/format.c
@@ -203,7 +203,7 @@ int af_format_conversion_score(int dst_format, int src_format)
} else {
int bytes = af_fmt_to_bytes(dst_format) - af_fmt_to_bytes(src_format);
if (bytes > 0) {
- score -= bytes; // has to add padding
+ score -= 1 + bytes; // has to add padding
} else if (bytes < 0) {
score -= 1024 - bytes; // has to reduce bit depth
}