summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-04-29 21:55:46 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2003-04-29 21:55:46 +0000
commitc226b5c184993b4dc09816e4da08a533b656f934 (patch)
tree548c51ffe6a46b5ee36aad927cd6fe9ded7b24fa
parenta1684eb4fdb2a9d9812d994f3a39904b15267905 (diff)
downloadxine-lib-c226b5c184993b4dc09816e4da08a533b656f934.tar.gz
xine-lib-c226b5c184993b4dc09816e4da08a533b656f934.tar.bz2
Update from libdvdnav
CVS patchset: 4712 CVS date: 2003/04/29 21:55:46
-rw-r--r--src/input/libdvdnav/bswap.h2
-rw-r--r--src/input/libdvdnav/decoder.c9
-rw-r--r--src/input/libdvdnav/dvd_input.c22
-rw-r--r--src/input/libdvdnav/dvd_reader.c46
-rw-r--r--src/input/libdvdnav/dvd_reader.h7
-rw-r--r--src/input/libdvdnav/dvd_udf.c33
-rw-r--r--src/input/libdvdnav/dvdnav.c4
-rw-r--r--src/input/libdvdnav/ifo_print.c6
-rw-r--r--src/input/libdvdnav/ifo_read.c12
-rw-r--r--src/input/libdvdnav/read_cache.c4
-rw-r--r--src/input/libdvdnav/searching.c10
-rw-r--r--src/input/libdvdnav/vm.c5
-rw-r--r--src/input/libdvdnav/vm.h4
13 files changed, 107 insertions, 57 deletions
diff --git a/src/input/libdvdnav/bswap.h b/src/input/libdvdnav/bswap.h
index 9c7402957..ed5d2dade 100644
--- a/src/input/libdvdnav/bswap.h
+++ b/src/input/libdvdnav/bswap.h
@@ -65,7 +65,7 @@
* functionality!
*/
-#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
+#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32)
#define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8))
diff --git a/src/input/libdvdnav/decoder.c b/src/input/libdvdnav/decoder.c
index 154bac848..76b1cc048 100644
--- a/src/input/libdvdnav/decoder.c
+++ b/src/input/libdvdnav/decoder.c
@@ -18,7 +18,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: decoder.c,v 1.8 2003/04/07 18:10:45 mroi Exp $
+ * $Id: decoder.c,v 1.9 2003/04/29 21:55:47 jcdutton Exp $
*
*/
@@ -32,14 +32,15 @@
#include <string.h> /* For memset */
#include "ifo_types.h" /* vm_cmd_t */
#include <assert.h>
+
#include "dvdnav_internal.h"
uint32_t vm_getbits(command_t *command, int start, int count) {
uint64_t result = 0;
- uint64_t bit_mask=0xffffffffffffffff; /* I could put -1 instead */
+ uint64_t bit_mask = 0;
uint64_t examining = 0;
int32_t bits;
-
+
if (count == 0) return 0;
if ( ((start - count) < -1) ||
@@ -50,6 +51,8 @@ uint32_t vm_getbits(command_t *command, int start, int count) {
fprintf(MSG_OUT, "libdvdnav: Bad call to vm_getbits. Parameter out of range\n");
assert(0);
}
+ /* all ones, please */
+ bit_mask = ~bit_mask;
bit_mask >>= 63 - start;
bits = start + 1 - count;
examining = ((bit_mask >> bits) << bits );
diff --git a/src/input/libdvdnav/dvd_input.c b/src/input/libdvdnav/dvd_input.c
index decc5c42a..bad7097a2 100644
--- a/src/input/libdvdnav/dvd_input.c
+++ b/src/input/libdvdnav/dvd_input.c
@@ -24,9 +24,18 @@
#include <fcntl.h>
#include <unistd.h>
+#include <dlfcn.h>
+
#include "dvd_reader.h"
#include "dvd_input.h"
+
+#ifndef _MSC_VER
+#define LIBDVDCSS_NAME = "libdvdcss.so.2"
+#else
+#define LIBDVDCSS_NAME = "libdvdcss.dll"
+#endif
+
/* The function pointers that is the exported interface of this file. */
dvd_input_t (*dvdinput_open) (const char *);
int (*dvdinput_close) (dvd_input_t);
@@ -45,8 +54,10 @@ char * (*dvdinput_error) (dvd_input_t);
#define DVDcss_read dvdcss_read
#define DVDcss_error dvdcss_error
#else
+
/* dlopening libdvdcss */
#include <dlfcn.h>
+
typedef struct dvdcss_s *dvdcss_handle;
static dvdcss_handle (*DVDcss_open) (const char *);
static int (*DVDcss_close) (dvdcss_handle);
@@ -74,7 +85,7 @@ static dvd_input_t css_open(const char *target)
dvd_input_t dev;
/* Allocate the handle structure */
- dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
+ dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
@@ -154,7 +165,7 @@ static dvd_input_t file_open(const char *target)
dvd_input_t dev;
/* Allocate the library structure */
- dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
+ dev = (dvd_input_t) malloc(sizeof(*dev));
if(dev == NULL) {
fprintf(stderr, "libdvdread: Could not allocate memory.\n");
return NULL;
@@ -274,8 +285,13 @@ int dvdinput_setup(void)
#else
/* dlopening libdvdcss */
+
+#ifndef _MSC_VER
dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
-
+#else
+ dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY);
+#endif
+
if(dvdcss_library != NULL) {
#if defined(__OpenBSD__) && !defined(__ELF__)
#define U_S "_"
diff --git a/src/input/libdvdnav/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c
index fa9df2a34..8424e0740 100644
--- a/src/input/libdvdnav/dvd_reader.c
+++ b/src/input/libdvdnav/dvd_reader.c
@@ -314,29 +314,30 @@ dvd_reader_t *DVDOpen( const char *path )
#ifdef _MSC_VER
-#ifdef WIN32_CSS
/* Try to open libdvdcss or fall back to standard functions */
have_css = dvdinput_setup();
return DVDOpenImageFile( path, have_css );
-#else
- /* Under Win32, we only try to open image files */
- return DVDOpenImageFile( path, DVDInputSetup() );
-#endif
#else
+ /* Try to open libdvdcss or fall back to standard functions */
+ have_css = dvdinput_setup();
+
ret = stat( path, &fileinfo );
if( ret < 0 ) {
+
+ /* maybe "host:port" url? try opening it with acCeSS library */
+ if( strchr(path,':') ) {
+ return DVDOpenImageFile( path, have_css );
+ }
+
/* If we can't stat the file, give up */
fprintf( stderr, "libdvdread: Can't stat %s\n", path );
perror("");
return 0;
}
- /* Try to open libdvdcss or fall back to standard functions */
- have_css = dvdinput_setup();
-
/* First check if this is a block/char device or a file*/
if( S_ISBLK( fileinfo.st_mode ) ||
S_ISCHR( fileinfo.st_mode ) ||
@@ -953,7 +954,7 @@ int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset )
ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
{
- unsigned char *secbuf;
+ unsigned char *secbuf_base, *secbuf;
unsigned int numsec, seek_sector, seek_byte;
int ret;
@@ -967,8 +968,9 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
numsec = ( ( seek_byte + byte_size ) / DVD_VIDEO_LB_LEN ) +
( ( ( seek_byte + byte_size ) % DVD_VIDEO_LB_LEN ) ? 1 : 0 );
- secbuf = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN );
- if( !secbuf ) {
+ secbuf_base = (unsigned char *) malloc( numsec * DVD_VIDEO_LB_LEN + 2048 );
+ secbuf = (unsigned char *)(((int)secbuf_base & ~2047) + 2048);
+ if( !secbuf_base ) {
fprintf( stderr, "libdvdread: Can't allocate memory "
"for file read!\n" );
return 0;
@@ -983,12 +985,12 @@ ssize_t DVDReadBytes( dvd_file_t *dvd_file, void *data, size_t byte_size )
}
if( ret != (int) numsec ) {
- free( secbuf );
+ free( secbuf_base );
return ret < 0 ? ret : 0;
}
memcpy( data, &(secbuf[ seek_byte ]), byte_size );
- free( secbuf );
+ free( secbuf_base );
dvd_file->seek_pos += byte_size;
return byte_size;
@@ -1020,9 +1022,10 @@ int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid )
if( dvd_file != NULL ) {
ssize_t bytes_read;
size_t file_size = dvd_file->filesize * DVD_VIDEO_LB_LEN;
- char *buffer = malloc( file_size );
+ char *buffer_base = malloc( file_size + 2048 );
+ char *buffer = (unsigned char *)(((int)buffer_base & ~2047) + 2048);
- if( buffer == NULL ) {
+ if( buffer_base == NULL ) {
fprintf( stderr, "libdvdread: DVDDiscId, failed to "
"allocate memory for file read!\n" );
return -1;
@@ -1032,13 +1035,14 @@ int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid )
fprintf( stderr, "libdvdread: DVDDiscId read returned %d bytes"
", wanted %d\n", bytes_read, file_size );
DVDCloseFile( dvd_file );
+ free( buffer_base );
return -1;
}
md5_process_bytes( buffer, file_size, &ctx );
DVDCloseFile( dvd_file );
- free( buffer );
+ free( buffer_base );
}
}
md5_finish_ctx( &ctx, discid );
@@ -1051,7 +1055,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
char *volid, unsigned int volid_size,
unsigned char *volsetid, unsigned int volsetid_size )
{
- unsigned char *buffer;
+ unsigned char *buffer, *buffer_base;
int ret;
/* Check arguments. */
@@ -1063,8 +1067,10 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
return -1;
}
- buffer = malloc( DVD_VIDEO_LB_LEN );
- if( buffer == NULL ) {
+ buffer_base = malloc( DVD_VIDEO_LB_LEN + 2048 );
+ buffer = (unsigned char *)(((int)buffer_base & ~2047) + 2048);
+
+ if( buffer_base == NULL ) {
fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
"allocate memory for file read!\n" );
return -1;
@@ -1074,6 +1080,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
if( ret != 1 ) {
fprintf( stderr, "libdvdread: DVDISOVolumeInfo, failed to "
"read ISO9660 Primary Volume Descriptor!\n" );
+ free( buffer_base );
return -1;
}
@@ -1099,6 +1106,7 @@ int DVDISOVolumeInfo( dvd_reader_t *dvd,
}
memcpy(volsetid, &buffer[190], volsetid_size);
}
+ free( buffer_base );
return 0;
}
diff --git a/src/input/libdvdnav/dvd_reader.h b/src/input/libdvdnav/dvd_reader.h
index cc4ba5489..edd18da77 100644
--- a/src/input/libdvdnav/dvd_reader.h
+++ b/src/input/libdvdnav/dvd_reader.h
@@ -21,6 +21,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifdef _MSC_VER
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+
#include <sys/types.h>
/**
diff --git a/src/input/libdvdnav/dvd_udf.c b/src/input/libdvdnav/dvd_udf.c
index 9ace65c14..b65d7e659 100644
--- a/src/input/libdvdnav/dvd_udf.c
+++ b/src/input/libdvdnav/dvd_udf.c
@@ -241,7 +241,7 @@ static int SetUDFCache(dvd_reader_t *device, UDFCacheType type,
if(c == NULL) {
c = calloc(1, sizeof(struct udf_cache));
- /* fprintf(stderr, "calloc: %d\n", sizeof(struct udf_cache)); */
+ /* fprintf(stderr, "calloc: %d\n", sizeof(struct udf_cache)); */
if(c == NULL) {
return 0;
}
@@ -379,7 +379,7 @@ static int UDFLongAD( uint8_t *data, struct AD *ad )
ad->Length &= 0x3FFFFFFF;
ad->Location = GETN4(4);
ad->Partition = GETN2(8);
- /*GETN(10, 6, Use);*/
+ /* GETN(10, 6, Use); */
return 0;
}
@@ -390,7 +390,7 @@ static int UDFExtAD( uint8_t *data, struct AD *ad )
ad->Length &= 0x3FFFFFFF;
ad->Location = GETN4(12);
ad->Partition = GETN2(16);
- /*GETN(10, 6, Use);*/
+ /* GETN(10, 6, Use); */
return 0;
}
@@ -440,7 +440,7 @@ static int UDFFileEntry( uint8_t *data, uint8_t *FileType,
/* Init ad for an empty file (i.e. there isn't a AD, L_AD == 0 ) */
ad->Length = GETN4( 60 ); /* Really 8 bytes a 56 */
ad->Flags = 0;
- ad->Location = 0; /* what should we put here? */
+ ad->Location = 0; /* what should we put here? */
ad->Partition = partition->Number; /* use number of current partition */
L_EA = GETN4( 168 );
@@ -491,7 +491,8 @@ static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristics,
static int UDFMapICB( dvd_reader_t *device, struct AD ICB, uint8_t *FileType,
struct Partition *partition, struct AD *File )
{
- uint8_t LogBlock[DVD_VIDEO_LB_LEN];
+ uint8_t LogBlock_base[DVD_VIDEO_LB_LEN + 2048];
+ uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048);
uint32_t lbnum;
uint16_t TagID;
struct icbmap tmpmap;
@@ -535,12 +536,13 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName,
int cache_file_info)
{
char filename[ MAX_UDF_FILE_NAME_LEN ];
- uint8_t directory[ 2 * DVD_VIDEO_LB_LEN ];
+ uint8_t directory_base[ 2 * DVD_VIDEO_LB_LEN + 2048];
+ uint8_t *directory = (uint8_t *)(((int)directory_base & ~2047) + 2048);
uint32_t lbnum;
uint16_t TagID;
uint8_t filechar;
unsigned int p;
- uint8_t *cached_dir = NULL;
+ uint8_t *cached_dir_base = NULL, *cached_dir;
uint32_t dir_lba;
struct AD tmpICB;
int found = 0;
@@ -554,11 +556,12 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName,
if(!GetUDFCache(device, LBUDFCache, lbnum, &cached_dir)) {
dir_lba = (Dir.Length + DVD_VIDEO_LB_LEN) / DVD_VIDEO_LB_LEN;
- if((cached_dir = malloc(dir_lba * DVD_VIDEO_LB_LEN)) == NULL) {
+ if((cached_dir_base = malloc(dir_lba * DVD_VIDEO_LB_LEN + 2048)) == NULL) {
return 0;
}
+ cached_dir = (uint8_t *)(((int)cached_dir_base & ~2047) + 2048);
if( DVDReadLBUDF( device, lbnum, dir_lba, cached_dir, 0) <= 0 ) {
- free(cached_dir);
+ free(cached_dir_base);
cached_dir = NULL;
}
/*
@@ -646,7 +649,8 @@ static int UDFScanDir( dvd_reader_t *device, struct AD Dir, char *FileName,
static int UDFGetAVDP( dvd_reader_t *device,
struct avdp_t *avdp)
{
- uint8_t Anchor[ DVD_VIDEO_LB_LEN ];
+ uint8_t Anchor_base[ DVD_VIDEO_LB_LEN + 2048 ];
+ uint8_t *Anchor = (uint8_t *)(((int)Anchor_base & ~2047) + 2048);
uint32_t lbnum, MVDS_location, MVDS_length;
uint16_t TagID;
uint32_t lastsector;
@@ -717,7 +721,8 @@ static int UDFGetAVDP( dvd_reader_t *device,
static int UDFFindPartition( dvd_reader_t *device, int partnum,
struct Partition *part )
{
- uint8_t LogBlock[ DVD_VIDEO_LB_LEN ];
+ uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ];
+ uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048);
uint32_t lbnum, MVDS_location, MVDS_length;
uint16_t TagID;
int i, volvalid;
@@ -779,7 +784,8 @@ static int UDFFindPartition( dvd_reader_t *device, int partnum,
uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
uint32_t *filesize )
{
- uint8_t LogBlock[ DVD_VIDEO_LB_LEN ];
+ uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ];
+ uint8_t *LogBlock = (uint8_t *)(((int)LogBlock_base & ~2047) + 2048);
uint32_t lbnum;
uint16_t TagID;
struct Partition partition;
@@ -923,7 +929,8 @@ static int UDFGetDescriptor( dvd_reader_t *device, int id,
static int UDFGetPVD(dvd_reader_t *device, struct pvd_t *pvd)
{
- uint8_t pvd_buf[DVD_VIDEO_LB_LEN];
+ uint8_t pvd_buf_base[DVD_VIDEO_LB_LEN + 2048];
+ uint8_t *pvd_buf = (uint8_t *)(((int)pvd_buf_base & ~2047) + 2048);
if(GetUDFCache(device, PVDCache, 0, pvd)) {
return 1;
diff --git a/src/input/libdvdnav/dvdnav.c b/src/input/libdvdnav/dvdnav.c
index 78752b4d4..c319c712b 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.25 2003/04/29 18:57:28 jcdutton Exp $
+ * $Id: dvdnav.c,v 1.26 2003/04/29 21:55:49 jcdutton Exp $
*
*/
@@ -70,7 +70,7 @@ dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) {
struct timeval time;
/* Create a new structure */
- fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://xine.sf.net\n", VERSION);
+ fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://dvd.sf.net\n", VERSION);
(*dest) = NULL;
this = (dvdnav_t*)malloc(sizeof(dvdnav_t));
diff --git a/src/input/libdvdnav/ifo_print.c b/src/input/libdvdnav/ifo_print.c
index 6432aea09..50aeacd17 100644
--- a/src/input/libdvdnav/ifo_print.c
+++ b/src/input/libdvdnav/ifo_print.c
@@ -129,13 +129,13 @@ static void ifoPrint_video_attributes(video_attr_t *attr) {
printf("(please send a bug report) ");
}
- /* Wide is allways allowed..!!! */
+ /* Wide is allways allowed..!!! */
switch(attr->permitted_df) {
case 0:
printf("pan&scan+letterboxed ");
break;
case 1:
- printf("only pan&scan "); /*??*/
+ printf("only pan&scan "); /* ?? */
break;
case 2:
printf("only letterboxed ");
@@ -323,7 +323,7 @@ static void ifoPrint_audio_attributes(audio_attr_t *attr) {
case 4: /* Directors 2 */
printf("Director's comments 2 ");
break;
- /*case 4: Music score ? */
+ /* case 4: Music score ? */
default:
printf("(please send a bug report) ");
}
diff --git a/src/input/libdvdnav/ifo_read.c b/src/input/libdvdnav/ifo_read.c
index a4e5a92d6..7bc9a2769 100644
--- a/src/input/libdvdnav/ifo_read.c
+++ b/src/input/libdvdnav/ifo_read.c
@@ -851,8 +851,8 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) {
CHECK_VALUE(tt_srpt->title[i].pb_ty.zero_1 == 0);
CHECK_VALUE(tt_srpt->title[i].nr_of_angles != 0);
CHECK_VALUE(tt_srpt->title[i].nr_of_angles < 10);
- /* CHECK_VALUE(tt_srpt->title[i].nr_of_ptts != 0);
- XXX: this assertion breaks Ghostbusters: */
+ /* CHECK_VALUE(tt_srpt->title[i].nr_of_ptts != 0); */
+ /* XXX: this assertion breaks Ghostbusters: */
CHECK_VALUE(tt_srpt->title[i].nr_of_ptts < 1000); /* ?? */
CHECK_VALUE(tt_srpt->title[i].title_set_nr != 0);
CHECK_VALUE(tt_srpt->title[i].title_set_nr < 100); /* ?? */
@@ -1799,8 +1799,10 @@ int ifoRead_PGCI_UT(ifo_handle_t *ifofile) {
ifofile->pgci_ut = 0;
return 0;
}
- /* FIXME: Iterate and verify that all menus that should exists accordingly
- to pgci_ut->lu[i].exists really do? */
+ /*
+ * FIXME: Iterate and verify that all menus that should exists accordingly
+ * to pgci_ut->lu[i].exists really do?
+ */
}
return 1;
@@ -1910,7 +1912,7 @@ int ifoRead_VTS_ATRT(ifo_handle_t *ifofile) {
CHECK_ZERO(vts_atrt->zero_1);
CHECK_VALUE(vts_atrt->nr_of_vtss != 0);
- CHECK_VALUE(vts_atrt->nr_of_vtss < 100); /*??*/
+ CHECK_VALUE(vts_atrt->nr_of_vtss < 100); /* ?? */
CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) +
VTS_ATRT_SIZE < vts_atrt->last_byte + 1);
diff --git a/src/input/libdvdnav/read_cache.c b/src/input/libdvdnav/read_cache.c
index bb68a83ae..0e9ac568b 100644
--- a/src/input/libdvdnav/read_cache.c
+++ b/src/input/libdvdnav/read_cache.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: read_cache.c,v 1.8 2003/04/29 15:58:30 jcdutton Exp $
+ * $Id: read_cache.c,v 1.9 2003/04/29 21:55:52 jcdutton Exp $
*
*/
@@ -90,7 +90,7 @@ struct read_cache_s {
read_cache_chunk_t chunk[READ_CACHE_CHUNKS];
int current;
int freeing; /* is set to one when we are about to dispose the cache */
- int read_ahead_size;
+ uint32_t read_ahead_size;
int read_ahead_incr;
int last_sector;
pthread_mutex_t lock;
diff --git a/src/input/libdvdnav/searching.c b/src/input/libdvdnav/searching.c
index e058485b0..6893d9525 100644
--- a/src/input/libdvdnav/searching.c
+++ b/src/input/libdvdnav/searching.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: searching.c,v 1.15 2003/04/29 15:58:31 jcdutton Exp $
+ * $Id: searching.c,v 1.16 2003/04/29 21:55:53 jcdutton Exp $
*
*/
@@ -410,6 +410,14 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *this, unsigned int *pos,
pthread_mutex_unlock(&this->vm_lock);
return S_ERR;
}
+ if (this->position_current.hop_channel != this->vm->hop_channel ||
+ this->position_current.domain != state->domain ||
+ this->position_current.vts != state->vtsN ||
+ this->position_current.cell_restart != state->cell_restart) {
+ printerr("New position not yet determined.");
+ pthread_mutex_unlock(&this->vm_lock);
+ return S_ERR;
+ }
/* Get current sector */
cur_sector = this->vobu.vobu_start + this->vobu.blockN;
diff --git a/src/input/libdvdnav/vm.c b/src/input/libdvdnav/vm.c
index 05b98dd2b..c4120916d 100644
--- a/src/input/libdvdnav/vm.c
+++ b/src/input/libdvdnav/vm.c
@@ -19,7 +19,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: vm.c,v 1.20 2003/04/29 15:58:31 jcdutton Exp $
+ * $Id: vm.c,v 1.21 2003/04/29 21:55:53 jcdutton Exp $
*
*/
@@ -128,7 +128,7 @@ static void vm_print_current_domain_state(vm_t *vm) {
static void dvd_read_name(char *name, const char *device) {
int fd, i;
-#ifndef __FreeBSD__
+#if !defined(__FreeBSD__) && !defined(WIN32)
off64_t off;
#else
off_t off;
@@ -1843,4 +1843,3 @@ void vm_position_print(vm_t *vm, vm_position_t *position) {
}
#endif
-
diff --git a/src/input/libdvdnav/vm.h b/src/input/libdvdnav/vm.h
index 1705a7ec9..c289ddb3a 100644
--- a/src/input/libdvdnav/vm.h
+++ b/src/input/libdvdnav/vm.h
@@ -19,7 +19,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: vm.h,v 1.8 2003/04/07 18:10:52 mroi Exp $
+ * $Id: vm.h,v 1.9 2003/04/29 21:55:54 jcdutton Exp $
*
*/
@@ -64,7 +64,7 @@ typedef struct {
typedef struct vm_position_s {
int16_t button; /* Button highlighted */
int32_t vts; /* vts number to use */
- int32_t domain; /* domain to use */
+ domain_t domain; /* domain to use */
int32_t spu_channel; /* spu channel to use */
int32_t angle_channel; /* angle channel to use */
int32_t audio_channel; /* audio channel to use */