Patches attached.

1. UDVGetVolumeIdentifier fails.
UDFGetVolumeIdentifier calls UDFGetPVD calls UDFGetDescriptor which fails
because bufsize is to small (8 bytes).  The error is in the call.
 if(!UDFGetDescriptor( device, 1, pvd_buf, sizeof(pvd_buf)))
sizeof(pvd_buf) gives the size of the pointer and not what it points at.  It
should be:
 if(!UDFGetDescriptor( device, 1, pvd_buf, DVD_VIDEO_LB_LEN))


2. libdvdread builds incorrectly on os x (darwin)
dvd_reader.c uses the define __DARWIN__ to enable darwin specific code, but it
is never defined anywhere.

3. Conversion of disk names to raw disk names incorrect.
On darwin and other bsd based systems, dvd_reader.c converts regular device
names to raw device names. e.g. "/dev/disk4" -> "/dev/rdisk4"
The test that determines if the conversion needs to be done is broken. It is fixed in libdvdread version 0.9.7.

4. libdvdread on mingw fails reading at 2G boundary.  largefile support.

5. dvdnav_reset deadlock on vm_lock.
dvdnav_reset takes the lock, then latter calls dvdnav_clear which tries to take
the lock again.  dead.  the unlock that is immediately after dvdnav_clear
should be moved to before it.


diff -Naur libdvdread.orig/configure.ac libdvdread/configure.ac
--- libdvdread.orig/configure.ac        2009-01-08 17:57:10.000000000 -0500
+++ libdvdread/configure.ac     2009-04-24 01:50:56.000000000 -0400
@@ -145,6 +145,9 @@
   *cygwin*)
     LDFLAGS="-no-undefined $LDFLAGS"
     ;;
+  *darwin*)
+    AC_DEFINE(__DARWIN__, 1, Have Mac OS X system)
+    ;;
   *os2*)
     LDFLAGS="-no-undefined -Zbin-files $LDFLAGS"
     ;;
diff -Naur libdvdread.orig/src/dvd_reader.c libdvdread/src/dvd_reader.c
--- libdvdread.orig/src/dvd_reader.c    2009-03-13 21:28:21.000000000 -0400
+++ libdvdread/src/dvd_reader.c 2009-04-24 01:35:43.000000000 -0400
@@ -314,7 +314,7 @@
   char *new_path;
 
   /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */
-  if( !strncmp( path, "/dev/",  5 ) || strncmp( path, "/dev/r", 6 ) )
+  if( strncmp( path, "/dev/",  5 ) || !strncmp( path, "/dev/r", 6 ) )
     return (char *) strdup( path );
 
   /* Replace "/dev/" with "/dev/r" */
diff -Naur libdvdread.orig/src/dvd_input.h libdvdread/src/dvd_input.h
--- libdvdread.orig/src/dvd_input.h     2008-10-03 13:11:30.000000000 -0700
+++ libdvdread/src/dvd_input.h  2009-04-23 13:47:04.000000000 -0700
@@ -29,6 +29,24 @@
 
 #define DVDINPUT_READ_DECRYPT    (1 << 0)
 
+#if defined( __MINGW32__ )
+#   undef  lseek
+#   define lseek  _lseeki64
+#   undef  fseeko
+#   define fseeko fseeko64
+#   undef  ftello
+#   define ftello ftello64
+#   define flockfile(...)
+#   define funlockfile(...)
+#   define getc_unlocked getc
+#   undef  off_t
+#   define off_t off64_t
+#   undef  stat
+#   define stat  _stati64
+#   define fstat _fstati64
+#   define wstat _wstati64
+#endif
+
 typedef struct dvd_input_s *dvd_input_t;
 
 /**
diff -Naur libdvdread.orig/src/dvd_udf.c libdvdread/src/dvd_udf.c
--- libdvdread.orig/src/dvd_udf.c       2009-01-08 14:57:10.000000000 -0800
+++ libdvdread/src/dvd_udf.c    2009-04-23 13:36:08.000000000 -0700
@@ -928,7 +928,7 @@
   if(GetUDFCache(device, PVDCache, 0, pvd))
     return 1;
 
-  if(!UDFGetDescriptor( device, 1, pvd_buf, sizeof(pvd_buf)))
+  if(!UDFGetDescriptor( device, 1, pvd_buf, DVD_VIDEO_LB_LEN))
     return 0;
 
   memcpy(pvd->VolumeIdentifier, &pvd_buf[24], 32);
diff -Naur libdvdnav.orig/src/dvdnav.c libdvdnav/src/dvdnav.c
--- libdvdnav.orig/src/dvdnav.c 2009-03-13 18:28:22.000000000 -0700
+++ libdvdnav/src/dvdnav.c      2009-04-24 19:52:52.000000000 -0700
@@ -178,9 +178,9 @@
 #ifdef LOG_DEBUG
   fprintf(MSG_OUT, "libdvdnav: clearing dvdnav\n");
 #endif
+  pthread_mutex_unlock(&this->vm_lock);
   result = dvdnav_clear(this);
 
-  pthread_mutex_unlock(&this->vm_lock);
   return result;
 }
 
_______________________________________________
DVDnav-discuss mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss

Reply via email to