1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 04:45:33 +00:00

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.)
This commit is contained in:
wm4 2015-09-10 23:29:31 +02:00
parent dc04541ba8
commit e45f469280

View File

@ -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
}