[Mplayer-cvslog] CVS: main playtree.c,1.22,1.23

Reimar Döffinger CVS syncmail at mplayerhq.hu
Fri Nov 5 23:45:19 CET 2004


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv20328

Modified Files:
	playtree.c 
Log Message:
fix "last file is always played last" bug.


Index: playtree.c
===================================================================
RCS file: /cvsroot/mplayer/main/playtree.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- playtree.c	20 Oct 2004 17:30:29 -0000	1.22
+++ playtree.c	5 Nov 2004 22:45:16 -0000	1.23
@@ -525,7 +525,7 @@
 
   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--;




More information about the MPlayer-cvslog mailing list