[PATCH] Patches from MPlayer

Alex Beregszaszi <[email protected]> Sun, 3 Jul 2005 14:43:43 +0200
Newsgroups gmane.comp.video.mplayer.devel,gmane.comp.video.ogle.devel
Organization Free Software Network (http://www.fsn.hu/)
Message-ID <[email protected]>
Hi,

Attached is a patch from libmpdvdkit2 which is a combined library of
libdvdread and libdvdcss.

It has:

* DragonFly BSD support
* Win32 cygwin/mingw stuff

I'm not subscribed, so please CC.

-- 
Alex Beregszaszi 			e-mail: [email protected]
Free Software Network			cell: +36 70 3144424

_______________________________________________
MPlayer-dev-eng mailing list
[email protected]
http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
mplayer.diff (text/x-diff, 2.3 KB)
Index: bswap.h
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/bswap.h,v
retrieving revision 1.10
diff -u -r1.10 bswap.h
--- bswap.h	18 Jun 2003 13:35:03 -0000	1.10
+++ bswap.h	3 Jul 2005 12:34:59 -0000
@@ -69,6 +69,12 @@
       (((x) & 0x00000000000000ff) << 56))
 #endif /* _FreeBSD_version >= 500000 */
 
+#elif defined(__DragonFly__)
+#include <sys/endian.h>
+#define B2N_16(x) x = be16toh(x)
+#define B2N_32(x) x = be32toh(x)
+#define B2N_64(x) x = be64toh(x)
+
 /* This is a slow but portable implementation, it has multiple evaluation 
  * problems so beware.
  * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such 
Index: dvd_reader.c
===================================================================
RCS file: /cvsroot/ogle/libdvdread/dvdread/dvd_reader.c,v
retrieving revision 1.35
diff -u -r1.35 dvd_reader.c
--- dvd_reader.c	5 Aug 2003 12:44:11 -0000	1.35
+++ dvd_reader.c	3 Jul 2005 12:35:01 -0000
@@ -32,15 +32,17 @@
 #include <limits.h>
 #include <dirent.h>
  
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) || defined(__DragonFly__)
 #define SYS_BSD 1
 #endif
 
 #if defined(__sun)
 #include <sys/mnttab.h>
+#elif defined(hpux)
+#include </usr/conf/h/mnttab.h>
 #elif defined(SYS_BSD)
 #include <fstab.h>
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__CYGWIN__)
 #include <mntent.h>
 #endif
 
@@ -357,7 +359,7 @@
 	char *path_copy;
 #if defined(SYS_BSD)
 	struct fstab* fe;
-#elif defined(__sun) || defined(__linux__)
+#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__)
 	FILE *mntfile;
 #endif
 
@@ -430,7 +432,7 @@
 	    }
 	    fclose( mntfile );
 	}
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__CYGWIN__)
         mntfile = fopen( MOUNTED, "r" );
         if( mntfile ) {
             struct mntent *me;
@@ -449,6 +451,9 @@
             }
             fclose( mntfile );
 	}
+#elif defined(__MINGW32__)
+	auth_drive = DVDOpenImageFile( path, have_css );
+	dev_name = strdup(path);
 #endif
 	if( !dev_name ) {
 	  fprintf( stderr, "libdvdread: Couldn't find device name.\n" );