diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-09-04 11:07:47 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-09-04 11:07:47 +0000 |
commit | 0553f19ca2e0c262362e3ba8f827906c553418e8 (patch) | |
tree | 82e633e534af0ec16ce329c27bb3d5179a15bfd7 /src/input/libdvdnav/dvdnav.c | |
parent | 0b7b753a9fb15b5fb8d7ef9a4fae8bbe4822aa7b (diff) | |
download | xine-lib-0553f19ca2e0c262362e3ba8f827906c553418e8.tar.gz xine-lib-0553f19ca2e0c262362e3ba8f827906c553418e8.tar.bz2 |
sync to libdvdnav cvs
CVS patchset: 2603
CVS date: 2002/09/04 11:07:47
Diffstat (limited to 'src/input/libdvdnav/dvdnav.c')
-rw-r--r-- | src/input/libdvdnav/dvdnav.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/input/libdvdnav/dvdnav.c b/src/input/libdvdnav/dvdnav.c index 010821c3b..d1a4e7318 100644 --- a/src/input/libdvdnav/dvdnav.c +++ b/src/input/libdvdnav/dvdnav.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: dvdnav.c,v 1.6 2002/08/31 02:48:13 jcdutton Exp $ + * $Id: dvdnav.c,v 1.7 2002/09/04 11:07:47 mroi Exp $ * */ @@ -38,6 +38,7 @@ #include <stdlib.h> #include <stdio.h> +#include <sys/time.h> /* * NOTE: @@ -175,17 +176,20 @@ dvdnav_status_t dvdnav_clear(dvdnav_t * this) { dvdnav_status_t dvdnav_open(dvdnav_t** dest, char *path) { dvdnav_t *this; + struct timeval time; /* Create a new structure */ - fprintf(MSG_OUT, "libdvdnav: Using dvdnav version from http://xine.sf.net\n"); + fprintf(MSG_OUT, "libdvdnav: Using dvdnav version (devel-ref:jcd1) from http://xine.sf.net\n"); /* FIXME: We malloc() here, but if an error occurs inside dvdnav_open(), * we return but never free() it. */ + (*dest) = NULL; this = (dvdnav_t*)malloc(sizeof(dvdnav_t)); if(!this) return S_ERR; memset(this, 0, (sizeof(dvdnav_t) ) ); /* Make sure this structure is clean */ + (*dest) = this; pthread_mutex_init(&this->vm_lock, NULL); /* Initialise the error string */ @@ -212,16 +216,15 @@ dvdnav_status_t dvdnav_open(dvdnav_t** dest, char *path) { if (this->file) DVDCloseFile(this->file); this->file = NULL; - //if(!this->started) { - // /* Start the VM */ - // vm_start(this->vm); - // this->started = 1; - //} - /* Start the read-ahead cache. */ this->cache = dvdnav_read_cache_new(this); - - (*dest) = this; + + /* Seed the random numbers. So that the DVD VM Command rand()i + * gives a different start value each time a DVD is played. + */ + gettimeofday(&time,NULL); + srand(time.tv_usec); + return S_OK; } @@ -292,14 +295,6 @@ dvdnav_status_t dvdnav_reset(dvdnav_t *this) { #endif result=dvdnav_clear(this); #ifdef LOG_DEBUG - fprintf(MSG_OUT, "libdvdnav: starting vm\n"); -#endif -// if(!this->started) { -// /* Start the VM */ -// vm_start(this->vm); -// this->started = 1; -// } -#ifdef LOG_DEBUG fprintf(MSG_OUT, "libdvdnav: unlocking\n"); #endif pthread_mutex_unlock(&this->vm_lock); @@ -1003,6 +998,9 @@ uint32_t dvdnav_get_next_still_flag(dvdnav_t *this) { /* * $Log: dvdnav.c,v $ + * Revision 1.7 2002/09/04 11:07:47 mroi + * sync to libdvdnav cvs + * * Revision 1.6 2002/08/31 02:48:13 jcdutton * Add a printf so we can tell if a user is using xine's libdvdnav or the one from * dvd.sf.net. |