Merge branch 'v0.21.x'

This commit is contained in:
Max Kellermann
2020-07-01 22:09:33 +02:00
5 changed files with 122 additions and 28 deletions

View File

@@ -310,7 +310,8 @@ osx_output_score_sample_rate(Float64 destination_rate, unsigned source_rate)
double int_portion;
double frac_portion = modf(source_rate / destination_rate, &int_portion);
// prefer sample rates that are multiples of the source sample rate
score += (1 - frac_portion) * 1000;
if (frac_portion < 0.01 || frac_portion >= 0.99)
score += 1000;
// prefer exact matches over other multiples
score += (int_portion == 1.0) ? 500 : 0;
if (source_rate == destination_rate)