mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-23 11:28:42 +08:00
b9c48ca8f3
The old algorithm produced results which were not uniformly distributed, i.e. some particular shuffles were preferred over others. The new algorithm is an implementation of the Fisher-Yates shuffle which is guaranteed to shuffle uniformly given a sufficiently uniform rand() and ignoring potential floating-point errors. Signed-off-by: wm4 <wm4@nowhere>