diff --git a/NEWS b/NEWS index 99c52a92b..308e70712 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ ver 0.21.25 (not yet released) * input - file: detect premature end of file - smbclient: don't send credentials to MPD clients +* output + - osx: improve sample rate selection * Windows/Android: - fix Boost detection after breaking change in Meson 0.54 diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index 7f84e6e83..da7bb4f19 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -342,7 +342,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)