diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-01 18:03:34 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-01 18:03:34 -0700 |
commit | cf1f842a4c8f760c4c6a41f0dadc6c173a182d4f (patch) | |
tree | 901cd1238a1cccb035e54d0e75ff1af520c4c413 /src/ioops.c | |
parent | 36984e9e8c7ccb33f43a9f096e848d28e532dc6e (diff) | |
download | mpd-cf1f842a4c8f760c4c6a41f0dadc6c173a182d4f.tar.gz mpd-cf1f842a4c8f760c4c6a41f0dadc6c173a182d4f.tar.xz mpd-cf1f842a4c8f760c4c6a41f0dadc6c173a182d4f.zip |
playlist: fix shuffle/random distribution
Previously we were using a naive randomization algorithm that
could shuffle already shuffled songs. Now we attempt to
correctly[1] implement the Fisher-Yates shuffle.
[1] Note: I absolutely suck at basic arithmetic, so there could
be off-by-one errors in here, too. I've added assertions in
swapSongs and swapOrder functions to more quickly detect them.
Diffstat (limited to 'src/ioops.c')
0 files changed, 0 insertions, 0 deletions