powerful and easy to use. MOC plays smoothly, regardless of system or I/O load because it uses the output buffer in a separate thread. It provides gapless playback because the next file to be played is precached while the current file is playing. Supported file formats are: MP3, Ogg Vorbis, FLAC, Musepack (mpc), Speex, Opus, WAVE, those supported by FFmpeg/LibAV (e.g., WMA, RealAudio, AAC, MP4), AIFF, AU, SVX, Sphere Nist WAV, IRCAM SF, Creative VOC, SID, wavpack. OK zhuk@
17 lines
500 B
Plaintext
17 lines
500 B
Plaintext
$OpenBSD: patch-playlist_c,v 1.1.1.1 2016/07/10 10:40:43 czarkoff Exp $
|
|
|
|
Replace rand(3)-based computation with arc4random_uniform(3).
|
|
|
|
--- playlist.c.orig Sun Jun 5 13:54:04 2016
|
|
+++ playlist.c Sun Jun 5 13:58:53 2016
|
|
@@ -774,8 +774,7 @@ void plist_shuffle (struct plist *plist)
|
|
int i;
|
|
|
|
for (i = 0; i < plist->num; i++)
|
|
- plist_swap (plist, i,
|
|
- (rand()/(float)RAND_MAX) * (plist->num - 1));
|
|
+ plist_swap (plist, i, arc4random_uniform(plist->num));
|
|
|
|
rb_clear (&plist->search_tree);
|
|
|