]> git.sesse.net Git - vlc/blobdiff - modules/access/vcdx/vcdplayer.c
Use VLC_CODEC_S24(B|L)32
[vlc] / modules / access / vcdx / vcdplayer.c
index 8efe2aef1b637eded989d2fdf58704c4cb130218..a14c5f7b2692139517053243d6f951ae8da183d2 100644 (file)
@@ -5,19 +5,19 @@
  * Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
  * $Id$
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*
@@ -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,22 +551,12 @@ 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;
         }
       }
       break;
     }
-  case VCDINFO_ITEM_TYPE_NOTFOUND:
-    LOG_ERR( "NOTFOUND in PBC -- not supposed to happen" );
-    break;
-  case VCDINFO_ITEM_TYPE_SPAREID2:
-    LOG_ERR( "SPAREID2 in PBC -- not supposed to happen" );
-    break;
-  case VCDINFO_ITEM_TYPE_LID:
-    LOG_ERR( "LID in PBC -- not supposed to happen" );
-    break;
   default:
     ;
   }