14861
|
1 --- common.h 2003-06-13 19:33:35.000000000 +0200
|
|
2 +++ common.h 2005-03-01 07:41:41.000000000 +0100
|
16630
|
3 @@ -27,21 +27,10 @@
|
14861
|
4 /*****************************************************************************
|
|
5 * Basic types definitions
|
|
6 *****************************************************************************/
|
|
7 -#if defined( HAVE_STDINT_H )
|
|
8 -# include <stdint.h>
|
|
9 -#elif defined( HAVE_INTTYPES_H )
|
|
10 -# include <inttypes.h>
|
|
11 -#elif defined( SYS_CYGWIN )
|
|
12 -# include <sys/types.h>
|
|
13 - /* Cygwin only defines half of these... */
|
|
14 - typedef u_int8_t uint8_t;
|
|
15 - typedef u_int32_t uint32_t;
|
|
16 -#else
|
|
17 - /* Fallback types (very x86-centric, sorry) */
|
|
18 - typedef unsigned char uint8_t;
|
|
19 - typedef signed char int8_t;
|
|
20 - typedef unsigned int uint32_t;
|
|
21 - typedef signed int int32_t;
|
|
22 +#include <inttypes.h>
|
|
23 +
|
|
24 +#ifdef __CYGWIN__
|
|
25 +#define SYS_CYGWIN
|
|
26 #endif
|
|
27
|
|
28 #if defined( WIN32 )
|
16630
|
29 --- css.c 2005-07-11 14:24:09.000000000 +0200
|
|
30 +++ css.c 2005-10-01 19:02:35.000000000 +0200
|
|
31 @@ -41,19 +41,11 @@
|
14861
|
32 #include <string.h>
|
|
33 #include <sys/types.h>
|
|
34 #include <sys/stat.h>
|
|
35 -#ifdef HAVE_SYS_PARAM_H
|
|
36 -# include <sys/param.h>
|
|
37 -#endif
|
|
38 -#ifdef HAVE_UNISTD_H
|
16630
|
39 # include <unistd.h>
|
14861
|
40 -#endif
|
|
41 #include <fcntl.h>
|
16630
|
42 -
|
14861
|
43 -#ifdef HAVE_LIMITS_H
|
16630
|
44 # include <limits.h>
|
14861
|
45 -#endif
|
16630
|
46
|
14861
|
47 -#include "dvdcss/dvdcss.h"
|
|
48 +#include "dvdcss.h"
|
|
49
|
|
50 #include "common.h"
|
|
51 #include "css.h"
|
16630
|
52 --- device.c 2005-07-11 13:33:34.000000000 +0200
|
|
53 +++ device.c 2005-10-01 19:08:07.000000000 +0200
|
|
54 @@ -31,23 +31,12 @@
|
|
55 #include <stdio.h>
|
|
56 #include <stdlib.h>
|
14861
|
57 #include <string.h>
|
16630
|
58 -#ifdef HAVE_ERRNO_H
|
|
59 # include <errno.h>
|
|
60 -#endif
|
14861
|
61 #include <sys/types.h>
|
|
62 #include <sys/stat.h>
|
|
63 -#ifdef HAVE_SYS_PARAM_H
|
|
64 -# include <sys/param.h>
|
|
65 -#endif
|
|
66 #include <fcntl.h>
|
|
67 -
|
|
68 -#ifdef HAVE_UNISTD_H
|
16630
|
69 # include <unistd.h>
|
14861
|
70 -#endif
|
|
71 -
|
|
72 -#ifdef HAVE_LIMITS_H
|
16630
|
73 # include <limits.h>
|
14861
|
74 -#endif
|
|
75
|
|
76 #if defined( WIN32 ) && !defined( SYS_CYGWIN )
|
|
77 # include <io.h> /* read() */
|
16630
|
78 @@ -55,7 +44,7 @@
|
14861
|
79 # include <sys/uio.h> /* struct iovec */
|
|
80 #endif
|
|
81
|
|
82 -#include "dvdcss/dvdcss.h"
|
|
83 +#include "dvdcss.h"
|
|
84
|
|
85 #include "common.h"
|
|
86 #include "css.h"
|
16630
|
87 @@ -143,8 +132,11 @@
|
|
88 print_debug( dvdcss, "opening target `%s'", psz_device );
|
14861
|
89
|
|
90 #if defined( WIN32 )
|
|
91 - /* If device is not "X:", we are actually opening a file. */
|
|
92 - dvdcss->b_file = !psz_device[0] || psz_device[1] != ':' || psz_device[2];
|
|
93 + dvdcss->b_file = 1;
|
|
94 + /* If device is "X:" or "X:\", we are not actually opening a file. */
|
|
95 + if (psz_device[0] && psz_device[1] == ':' &&
|
|
96 + (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
|
|
97 + dvdcss->b_file = 0;
|
|
98
|
|
99 /* Initialize readv temporary buffer */
|
|
100 dvdcss->p_readv_buffer = NULL;
|
16630
|
101 --- error.c 2004-02-24 16:46:49.000000000 +0100
|
|
102 +++ error.c 2005-10-01 19:10:06.000000000 +0200
|
|
103 @@ -25,16 +25,9 @@
|
14861
|
104
|
|
105 #include <stdio.h>
|
|
106 #include <stdlib.h>
|
16630
|
107 -
|
14861
|
108 -#ifdef HAVE_SYS_PARAM_H
|
|
109 -# include <sys/param.h>
|
|
110 -#endif
|
|
111 -
|
|
112 -#ifdef HAVE_LIMITS_H
|
16630
|
113 # include <limits.h>
|
14861
|
114 -#endif
|
16630
|
115
|
14861
|
116 -#include "dvdcss/dvdcss.h"
|
|
117 +#include "dvdcss.h"
|
|
118
|
|
119 #include "common.h"
|
|
120 #include "css.h"
|
16630
|
121 --- libdvdcss.c 2004-08-13 15:40:18.000000000 +0200
|
|
122 +++ libdvdcss.c 2005-10-01 19:11:27.000000000 +0200
|
|
123 @@ -87,10 +87,7 @@
|
14861
|
124 * values. This will speed up descrambling of DVDs which are in the
|
|
125 * cache. The DVDCSS_CACHE directory is created if it does not exist,
|
|
126 * and a subdirectory is created named after the DVD's title or
|
|
127 - * manufacturing date. If DVDCSS_CACHE is not set or is empty, \e libdvdcss
|
|
128 - * will use the default value which is "${HOME}/.dvdcss/" under Unix and
|
|
129 - * "C:\Documents and Settings\$USER\Application Data\dvdcss\" under Win32.
|
|
130 - * The special value "off" disables caching.
|
|
131 + * manufacturing date.
|
|
132 */
|
|
133
|
|
134 /*
|
16630
|
135 @@ -103,28 +100,12 @@
|
14861
|
136 #include <string.h>
|
|
137 #include <sys/types.h>
|
|
138 #include <sys/stat.h>
|
|
139 -#ifdef HAVE_SYS_PARAM_H
|
|
140 -# include <sys/param.h>
|
|
141 -#endif
|
|
142 -#ifdef HAVE_PWD_H
|
|
143 -# include <pwd.h>
|
|
144 -#endif
|
|
145 #include <fcntl.h>
|
|
146 #include <errno.h>
|
16630
|
147 -
|
14861
|
148 -#ifdef HAVE_UNISTD_H
|
16630
|
149 # include <unistd.h>
|
14861
|
150 -#endif
|
|
151 -
|
|
152 -#ifdef HAVE_LIMITS_H
|
16630
|
153 # include <limits.h>
|
14861
|
154 -#endif
|
16630
|
155
|
14861
|
156 -#ifdef HAVE_DIRECT_H
|
|
157 -# include <direct.h>
|
|
158 -#endif
|
|
159 -
|
|
160 -#include "dvdcss/dvdcss.h"
|
|
161 +#include "dvdcss.h"
|
|
162
|
|
163 #include "common.h"
|
|
164 #include "css.h"
|
16630
|
165 @@ -132,6 +113,12 @@
|
14861
|
166 #include "ioctl.h"
|
|
167 #include "device.h"
|
|
168
|
|
169 +#ifndef HAVE_MPLAYER
|
|
170 + #include "get_path.c"
|
|
171 +#else
|
|
172 + extern char * get_path( char * filename );
|
|
173 +#endif
|
|
174 +
|
|
175 /**
|
|
176 * \brief Symbol for version checks.
|
|
177 *
|
16630
|
178 @@ -233,6 +220,8 @@
|
|
179 }
|
14861
|
180 }
|
|
181
|
16630
|
182 +#if 0 /* MPlayer caches keys in its own configuration directory */
|
|
183 +
|
14861
|
184 /*
|
16630
|
185 * If DVDCSS_CACHE was not set, try to guess a default value
|
|
186 */
|
|
187 @@ -309,6 +298,8 @@
|
|
188 #endif
|
|
189 }
|
|
190
|
|
191 +#endif /* 0 */
|
|
192 +
|
|
193 /*
|
14861
|
194 * Find cache dir from the DVDCSS_CACHE environment variable
|
|
195 */
|
16630
|
196 @@ -326,6 +317,7 @@
|
14861
|
197 psz_cache = NULL;
|
|
198 }
|
|
199 }
|
|
200 + else psz_cache = get_path( "DVDKeys" );
|
|
201
|
|
202 /*
|
|
203 * Open device
|
16630
|
204 @@ -504,9 +496,10 @@
|
14861
|
205 dvdcss->psz_cachefile[0] = '\0';
|
|
206 goto nocache;
|
|
207 }
|
|
208 + i += sprintf( dvdcss->psz_cachefile + i, "/");
|
|
209
|
16630
|
210 - i += sprintf( dvdcss->psz_cachefile + i, "/%s-%s%s", psz_title,
|
|
211 - psz_serial, psz_key );
|
14861
|
212 +// i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data );
|
16630
|
213 + i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, psz_serial );
|
14861
|
214 #if !defined( WIN32 ) || defined( SYS_CYGWIN )
|
|
215 i_ret = mkdir( dvdcss->psz_cachefile, 0755 );
|
|
216 #else
|