]> git.sesse.net Git - vlc/blobdiff - modules/access/vcdx/vcdplayer.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / access / vcdx / vcdplayer.c
index 8efe2aef1b637eded989d2fdf58704c4cb130218..e955fb1e5ae84bcbf3af076ad093189b199768a7 100644 (file)
@@ -36,6 +36,7 @@
 #include <vlc_common.h>
 #include <vlc_input.h>
 #include <vlc_interface.h>
+#include <vlc_rand.h>
 
 #include "vcd.h"
 #include "vcdplayer.h"
@@ -538,7 +539,7 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
           /* Pick a random selection. */
           unsigned int bsn=vcdinf_get_bsn(p_vcdplayer->pxd.psd);
           int rand_selection=bsn +
-            (int) ((i_selections+0.0)*rand()/(RAND_MAX+1.0));
+            ((unsigned)vlc_lrand48() % (unsigned)i_selections);
           lid_t rand_lid=vcdinfo_selection_get_lid (p_vcdplayer->vcd,
                             p_vcdplayer->i_lid,
                             rand_selection);
@@ -550,7 +551,7 @@ vcdplayer_pbc_nav ( access_t * p_access, uint8_t *wait_time )
           return READ_BLOCK;
         } else if (p_vcdplayer->i_still) {
           /* Hack: Just go back and do still again */
-          msleep(1000);
+          msleep(10000);
           return READ_STILL_FRAME;
         }
       }