mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
fix "last file is always played last" bug.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13885 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
7bb5364bf7
commit
1e9749979b
@ -525,7 +525,7 @@ play_tree_rnd_step(play_tree_t* pt) {
|
||||
|
||||
if(!count) return NULL;
|
||||
|
||||
r = (int)((count-1.0) * rand() / RAND_MAX);
|
||||
r = (int)((float)(count) * rand() / (RAND_MAX + 1.0));
|
||||
|
||||
for(i = head ; i ; i=i->next) {
|
||||
if(!(i->flags & PLAY_TREE_RND_PLAYED)) r--;
|
||||
|
Loading…
Reference in New Issue
Block a user