2005-03-01 06:58:15 +00:00
|
|
|
--- common.h 2003-06-13 19:33:35.000000000 +0200
|
|
|
|
+++ common.h 2005-03-01 07:41:41.000000000 +0100
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -27,21 +27,10 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
* Basic types definitions
|
|
|
|
*****************************************************************************/
|
|
|
|
-#if defined( HAVE_STDINT_H )
|
|
|
|
-# include <stdint.h>
|
|
|
|
-#elif defined( HAVE_INTTYPES_H )
|
|
|
|
-# include <inttypes.h>
|
|
|
|
-#elif defined( SYS_CYGWIN )
|
|
|
|
-# include <sys/types.h>
|
|
|
|
- /* Cygwin only defines half of these... */
|
|
|
|
- typedef u_int8_t uint8_t;
|
|
|
|
- typedef u_int32_t uint32_t;
|
|
|
|
-#else
|
|
|
|
- /* Fallback types (very x86-centric, sorry) */
|
|
|
|
- typedef unsigned char uint8_t;
|
|
|
|
- typedef signed char int8_t;
|
|
|
|
- typedef unsigned int uint32_t;
|
|
|
|
- typedef signed int int32_t;
|
|
|
|
+#include <inttypes.h>
|
|
|
|
+
|
|
|
|
+#ifdef __CYGWIN__
|
|
|
|
+#define SYS_CYGWIN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined( WIN32 )
|
2005-10-01 17:19:33 +00:00
|
|
|
--- css.c 2005-07-11 14:24:09.000000000 +0200
|
|
|
|
+++ css.c 2005-10-01 19:02:35.000000000 +0200
|
|
|
|
@@ -41,19 +41,11 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
-#ifdef HAVE_SYS_PARAM_H
|
|
|
|
-# include <sys/param.h>
|
|
|
|
-#endif
|
|
|
|
-#ifdef HAVE_UNISTD_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <unistd.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
|
|
|
#include <fcntl.h>
|
2005-10-01 17:19:33 +00:00
|
|
|
-
|
2005-03-01 06:58:15 +00:00
|
|
|
-#ifdef HAVE_LIMITS_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <limits.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
2005-10-01 17:19:33 +00:00
|
|
|
|
2005-03-01 06:58:15 +00:00
|
|
|
-#include "dvdcss/dvdcss.h"
|
|
|
|
+#include "dvdcss.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "css.h"
|
2005-10-01 17:19:33 +00:00
|
|
|
--- device.c 2005-07-11 13:33:34.000000000 +0200
|
|
|
|
+++ device.c 2005-10-01 19:08:07.000000000 +0200
|
|
|
|
@@ -31,23 +31,12 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
#include <string.h>
|
2005-10-01 17:19:33 +00:00
|
|
|
-#ifdef HAVE_ERRNO_H
|
|
|
|
# include <errno.h>
|
|
|
|
-#endif
|
2005-03-01 06:58:15 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
-#ifdef HAVE_SYS_PARAM_H
|
|
|
|
-# include <sys/param.h>
|
|
|
|
-#endif
|
|
|
|
#include <fcntl.h>
|
|
|
|
-
|
|
|
|
-#ifdef HAVE_UNISTD_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <unistd.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#ifdef HAVE_LIMITS_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <limits.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
|
|
|
|
|
|
|
#if defined( WIN32 ) && !defined( SYS_CYGWIN )
|
|
|
|
# include <io.h> /* read() */
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -55,7 +44,7 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
# include <sys/uio.h> /* struct iovec */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
-#include "dvdcss/dvdcss.h"
|
|
|
|
+#include "dvdcss.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "css.h"
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -143,8 +132,11 @@
|
|
|
|
print_debug( dvdcss, "opening target `%s'", psz_device );
|
2005-03-01 06:58:15 +00:00
|
|
|
|
|
|
|
#if defined( WIN32 )
|
|
|
|
- /* If device is not "X:", we are actually opening a file. */
|
|
|
|
- dvdcss->b_file = !psz_device[0] || psz_device[1] != ':' || psz_device[2];
|
|
|
|
+ dvdcss->b_file = 1;
|
|
|
|
+ /* If device is "X:" or "X:\", we are not actually opening a file. */
|
|
|
|
+ if (psz_device[0] && psz_device[1] == ':' &&
|
|
|
|
+ (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
|
|
|
|
+ dvdcss->b_file = 0;
|
|
|
|
|
|
|
|
/* Initialize readv temporary buffer */
|
|
|
|
dvdcss->p_readv_buffer = NULL;
|
2005-10-01 17:19:33 +00:00
|
|
|
--- error.c 2004-02-24 16:46:49.000000000 +0100
|
|
|
|
+++ error.c 2005-10-01 19:10:06.000000000 +0200
|
|
|
|
@@ -25,16 +25,9 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2005-10-01 17:19:33 +00:00
|
|
|
-
|
2005-03-01 06:58:15 +00:00
|
|
|
-#ifdef HAVE_SYS_PARAM_H
|
|
|
|
-# include <sys/param.h>
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#ifdef HAVE_LIMITS_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <limits.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
2005-10-01 17:19:33 +00:00
|
|
|
|
2005-03-01 06:58:15 +00:00
|
|
|
-#include "dvdcss/dvdcss.h"
|
|
|
|
+#include "dvdcss.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "css.h"
|
2005-10-01 17:19:33 +00:00
|
|
|
--- libdvdcss.c 2004-08-13 15:40:18.000000000 +0200
|
|
|
|
+++ libdvdcss.c 2005-10-01 19:11:27.000000000 +0200
|
|
|
|
@@ -87,10 +87,7 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
* values. This will speed up descrambling of DVDs which are in the
|
|
|
|
* cache. The DVDCSS_CACHE directory is created if it does not exist,
|
|
|
|
* and a subdirectory is created named after the DVD's title or
|
|
|
|
- * manufacturing date. If DVDCSS_CACHE is not set or is empty, \e libdvdcss
|
|
|
|
- * will use the default value which is "${HOME}/.dvdcss/" under Unix and
|
|
|
|
- * "C:\Documents and Settings\$USER\Application Data\dvdcss\" under Win32.
|
|
|
|
- * The special value "off" disables caching.
|
|
|
|
+ * manufacturing date.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -103,28 +100,12 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
-#ifdef HAVE_SYS_PARAM_H
|
|
|
|
-# include <sys/param.h>
|
|
|
|
-#endif
|
|
|
|
-#ifdef HAVE_PWD_H
|
|
|
|
-# include <pwd.h>
|
|
|
|
-#endif
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <errno.h>
|
2005-10-01 17:19:33 +00:00
|
|
|
-
|
2005-03-01 06:58:15 +00:00
|
|
|
-#ifdef HAVE_UNISTD_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <unistd.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#ifdef HAVE_LIMITS_H
|
2005-10-01 17:19:33 +00:00
|
|
|
# include <limits.h>
|
2005-03-01 06:58:15 +00:00
|
|
|
-#endif
|
2005-10-01 17:19:33 +00:00
|
|
|
|
2005-03-01 06:58:15 +00:00
|
|
|
-#ifdef HAVE_DIRECT_H
|
|
|
|
-# include <direct.h>
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#include "dvdcss/dvdcss.h"
|
|
|
|
+#include "dvdcss.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "css.h"
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -132,6 +113,12 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
#include "ioctl.h"
|
|
|
|
#include "device.h"
|
|
|
|
|
|
|
|
+#ifndef HAVE_MPLAYER
|
|
|
|
+ #include "get_path.c"
|
|
|
|
+#else
|
|
|
|
+ extern char * get_path( char * filename );
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
* \brief Symbol for version checks.
|
|
|
|
*
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -233,6 +220,8 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0 /* MPlayer caches keys in its own configuration directory */
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* If DVDCSS_CACHE was not set, try to guess a default value
|
|
|
|
*/
|
|
|
|
@@ -309,6 +298,8 @@
|
|
|
|
#endif
|
2005-03-01 06:58:15 +00:00
|
|
|
}
|
|
|
|
|
2005-10-01 17:19:33 +00:00
|
|
|
+#endif /* 0 */
|
|
|
|
+
|
2005-03-01 06:58:15 +00:00
|
|
|
/*
|
|
|
|
* Find cache dir from the DVDCSS_CACHE environment variable
|
|
|
|
*/
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -326,6 +317,7 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
psz_cache = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ else psz_cache = get_path( "DVDKeys" );
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Open device
|
2005-10-01 17:19:33 +00:00
|
|
|
@@ -504,9 +496,10 @@
|
2005-03-01 06:58:15 +00:00
|
|
|
dvdcss->psz_cachefile[0] = '\0';
|
|
|
|
goto nocache;
|
|
|
|
}
|
|
|
|
+ i += sprintf( dvdcss->psz_cachefile + i, "/");
|
|
|
|
|
2005-10-01 17:19:33 +00:00
|
|
|
- i += sprintf( dvdcss->psz_cachefile + i, "/%s-%s%s", psz_title,
|
|
|
|
- psz_serial, psz_key );
|
2005-03-01 06:58:15 +00:00
|
|
|
+// i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data );
|
2005-10-01 17:19:33 +00:00
|
|
|
+ i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, psz_serial );
|
2005-03-01 06:58:15 +00:00
|
|
|
#if !defined( WIN32 ) || defined( SYS_CYGWIN )
|
|
|
|
i_ret = mkdir( dvdcss->psz_cachefile, 0755 );
|
|
|
|
#else
|