[PATCH] improve ices2's playlist shuffler
The patch that I'll soon have attached below significantly improves ices2's shuffler randomness.
The quality of the PRNG is important to this new shuffler, which is why rand() is changed to the better-but-still-standard random(). To make this change consistent, rand() is changed to random() in src/encode.c as well (for the serial numbers.)
This implements the Knuth shuffle, AKA Fisher-Yates shuffle. Care has been taken to implement this subtle-and-quick-to-anger algorithm by testing it separately and making sure that it doesn't have any bias.
Works for me nicely over the course of several months now. If the PRNG were stronger, this should now have online-gambling quality. ;)
The additional LOG_DEBUG()s have proven useful, however, they are not necessary.
Achieving the same for ices-0.x would be trickier, iirc, and I personally am not too much interested in doing it.