* 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.
*****************************************************************************/
/*
#include <vlc_common.h>
#include <vlc_input.h>
#include <vlc_interface.h>
+#include <vlc_rand.h>
#include "vcd.h"
#include "vcdplayer.h"
/* 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);
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:
;
}