• Max Kellermann's avatar
    output/osx: improve sample rate selection · 691b6a23
    Max Kellermann authored
    The formula in osx_output_score_sample_rate() to detect multiples of
    the source sample rate was broken: when given a 44.1 kHz input file,
    it preferred 16 kHz over 48 kHz, because its `frac_portion(16)=0.75`
    is smaller than `frac_portion(48)=0.91`.
    
    That formula, introduced by commit 40a1ebee, looks completely
    wrong.  It doesn't do what the code comment pretends it does.
    
    Instead of using that `frac_portion` to calculate a score, this patch
    adds to the score only if `frac_portion` is nearly `0` or `1`.  This
    means that the factor is nearly integer.
    
    Closes https://github.com/MusicPlayerDaemon/MPD/issues/904
    691b6a23
Name
Last commit
Last update
android Loading commit data...
build Loading commit data...
doc Loading commit data...
python/build Loading commit data...
src Loading commit data...
systemd Loading commit data...
test Loading commit data...
win32 Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
mpd.svg Loading commit data...
valgrind.suppressions Loading commit data...