Mercurial > mplayer.hg
comparison libmpdvdkit2/libdvdcss_changes.diff @ 16630:954cdf2171f6
upgrade to libdvdcss 1.2.9
author | diego |
---|---|
date | Sat, 01 Oct 2005 17:19:33 +0000 |
parents | 05f2d8e27cf4 |
children | 2ab52c9b72b9 |
comparison
equal
deleted
inserted
replaced
16629:045e93202e4a | 16630:954cdf2171f6 |
---|---|
1 --- bsdi_ioctl.c 2003-03-10 00:34:10.000000000 +0100 | |
2 +++ bsdi_ioctl.c 2005-03-01 07:41:41.000000000 +0100 | |
3 @@ -694,7 +698,7 @@ | |
4 struct cdrom_tocentry entry; | |
5 int ret, i; | |
6 | |
7 - bzero(tracks, sizeof (*tracks)); | |
8 + memset(tracks, 0, sizeof (*tracks)); | |
9 ret = cdrom_ioctl(fd, CDROMREADTOCHDR, &header); | |
10 /* | |
11 * This whole business is a crock anyhow so we don't bother distinguishing | |
12 --- common.h 2003-06-13 19:33:35.000000000 +0200 | 1 --- common.h 2003-06-13 19:33:35.000000000 +0200 |
13 +++ common.h 2005-03-01 07:41:41.000000000 +0100 | 2 +++ common.h 2005-03-01 07:41:41.000000000 +0100 |
14 @@ -27,21 +30,10 @@ | 3 @@ -27,21 +27,10 @@ |
15 /***************************************************************************** | 4 /***************************************************************************** |
16 * Basic types definitions | 5 * Basic types definitions |
17 *****************************************************************************/ | 6 *****************************************************************************/ |
18 -#if defined( HAVE_STDINT_H ) | 7 -#if defined( HAVE_STDINT_H ) |
19 -# include <stdint.h> | 8 -# include <stdint.h> |
35 +#ifdef __CYGWIN__ | 24 +#ifdef __CYGWIN__ |
36 +#define SYS_CYGWIN | 25 +#define SYS_CYGWIN |
37 #endif | 26 #endif |
38 | 27 |
39 #if defined( WIN32 ) | 28 #if defined( WIN32 ) |
40 --- css.c 2003-07-29 01:37:06.000000000 +0200 | 29 --- css.c 2005-07-11 14:24:09.000000000 +0200 |
41 +++ css.c 2005-03-01 07:41:41.000000000 +0100 | 30 +++ css.c 2005-10-01 19:02:35.000000000 +0200 |
42 @@ -40,19 +43,11 @@ | 31 @@ -41,19 +41,11 @@ |
43 #include <string.h> | 32 #include <string.h> |
44 #include <sys/types.h> | 33 #include <sys/types.h> |
45 #include <sys/stat.h> | 34 #include <sys/stat.h> |
46 -#ifdef HAVE_SYS_PARAM_H | 35 -#ifdef HAVE_SYS_PARAM_H |
47 -# include <sys/param.h> | 36 -# include <sys/param.h> |
48 -#endif | 37 -#endif |
49 -#ifdef HAVE_UNISTD_H | 38 -#ifdef HAVE_UNISTD_H |
50 -# include <unistd.h> | 39 # include <unistd.h> |
51 -#endif | 40 -#endif |
52 #include <fcntl.h> | 41 #include <fcntl.h> |
53 +#include <unistd.h> | 42 - |
54 +#include <limits.h> | 43 -#ifdef HAVE_LIMITS_H |
55 | 44 # include <limits.h> |
56 -#ifdef HAVE_LIMITS_H | 45 -#endif |
57 -# include <limits.h> | 46 |
58 -#endif | 47 -#include "dvdcss/dvdcss.h" |
59 - | 48 +#include "dvdcss.h" |
60 -#include "dvdcss/dvdcss.h" | 49 |
61 +#include "dvdcss.h" | 50 #include "common.h" |
62 | 51 #include "css.h" |
63 #include "common.h" | 52 --- device.c 2005-07-11 13:33:34.000000000 +0200 |
64 #include "css.h" | 53 +++ device.c 2005-10-01 19:08:07.000000000 +0200 |
65 --- dvdcss/device.c 2005-06-07 19:22:40.181853664 +0200 | 54 @@ -31,23 +31,12 @@ |
66 +++ device.c 2005-06-07 15:36:21.000000000 +0200 | 55 #include <stdio.h> |
67 @@ -33,18 +36,9 @@ | 56 #include <stdlib.h> |
68 #include <string.h> | 57 #include <string.h> |
58 -#ifdef HAVE_ERRNO_H | |
59 # include <errno.h> | |
60 -#endif | |
69 #include <sys/types.h> | 61 #include <sys/types.h> |
70 #include <sys/stat.h> | 62 #include <sys/stat.h> |
71 -#ifdef HAVE_SYS_PARAM_H | 63 -#ifdef HAVE_SYS_PARAM_H |
72 -# include <sys/param.h> | 64 -# include <sys/param.h> |
73 -#endif | 65 -#endif |
74 #include <fcntl.h> | 66 #include <fcntl.h> |
75 - | 67 - |
76 -#ifdef HAVE_UNISTD_H | 68 -#ifdef HAVE_UNISTD_H |
77 -# include <unistd.h> | 69 # include <unistd.h> |
78 -#endif | 70 -#endif |
79 - | 71 - |
80 -#ifdef HAVE_LIMITS_H | 72 -#ifdef HAVE_LIMITS_H |
81 -# include <limits.h> | 73 # include <limits.h> |
82 -#endif | 74 -#endif |
83 +#include <unistd.h> | |
84 +#include <limits.h> | |
85 | 75 |
86 #if defined( WIN32 ) && !defined( SYS_CYGWIN ) | 76 #if defined( WIN32 ) && !defined( SYS_CYGWIN ) |
87 # include <io.h> /* read() */ | 77 # include <io.h> /* read() */ |
88 @@ -52,7 +46,7 @@ | 78 @@ -55,7 +44,7 @@ |
89 # include <sys/uio.h> /* struct iovec */ | 79 # include <sys/uio.h> /* struct iovec */ |
90 #endif | 80 #endif |
91 | 81 |
92 -#include "dvdcss/dvdcss.h" | 82 -#include "dvdcss/dvdcss.h" |
93 +#include "dvdcss.h" | 83 +#include "dvdcss.h" |
94 | 84 |
95 #include "common.h" | 85 #include "common.h" |
96 #include "css.h" | 86 #include "css.h" |
97 @@ -143,8 +137,11 @@ | 87 @@ -143,8 +132,11 @@ |
98 _dvdcss_debug( dvdcss, psz_debug ); | 88 print_debug( dvdcss, "opening target `%s'", psz_device ); |
99 | 89 |
100 #if defined( WIN32 ) | 90 #if defined( WIN32 ) |
101 - /* If device is not "X:", we are actually opening a file. */ | 91 - /* If device is not "X:", we are actually opening a file. */ |
102 - dvdcss->b_file = !psz_device[0] || psz_device[1] != ':' || psz_device[2]; | 92 - dvdcss->b_file = !psz_device[0] || psz_device[1] != ':' || psz_device[2]; |
103 + dvdcss->b_file = 1; | 93 + dvdcss->b_file = 1; |
106 + (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3]))) | 96 + (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3]))) |
107 + dvdcss->b_file = 0; | 97 + dvdcss->b_file = 0; |
108 | 98 |
109 /* Initialize readv temporary buffer */ | 99 /* Initialize readv temporary buffer */ |
110 dvdcss->p_readv_buffer = NULL; | 100 dvdcss->p_readv_buffer = NULL; |
111 @@ -276,14 +273,14 @@ | 101 --- error.c 2004-02-24 16:46:49.000000000 +0100 |
112 * won't send back the right result). | 102 +++ error.c 2005-10-01 19:10:06.000000000 +0200 |
113 * (See Microsoft Q241374: Read and Write Access Required for SCSI | 103 @@ -25,16 +25,9 @@ |
114 * Pass Through Requests) */ | |
115 - (HANDLE) dvdcss->i_fd = | |
116 + dvdcss->i_fd = (int) | |
117 CreateFile( psz_dvd, GENERIC_READ | GENERIC_WRITE, | |
118 FILE_SHARE_READ | FILE_SHARE_WRITE, | |
119 NULL, OPEN_EXISTING, | |
120 FILE_FLAG_RANDOM_ACCESS, NULL ); | |
121 | |
122 if( (HANDLE) dvdcss->i_fd == INVALID_HANDLE_VALUE ) | |
123 - (HANDLE) dvdcss->i_fd = | |
124 + dvdcss->i_fd = (int) | |
125 CreateFile( psz_dvd, GENERIC_READ, FILE_SHARE_READ, | |
126 NULL, OPEN_EXISTING, | |
127 FILE_FLAG_RANDOM_ACCESS, NULL ); | |
128 @@ -305,8 +302,8 @@ | |
129 DWORD dwSupportInfo; | |
130 struct w32_aspidev *fd; | |
131 int i, j, i_hostadapters; | |
132 - long (*lpGetSupport)( void ); | |
133 - long (*lpSendCommand)( void* ); | |
134 + GETASPI32SUPPORTINFO lpGetSupport; | |
135 + SENDASPI32COMMAND lpSendCommand; | |
136 char c_drive = psz_device[0]; | |
137 | |
138 /* load aspi and init w32_aspidev structure */ | |
139 @@ -317,8 +314,8 @@ | |
140 return -1; | |
141 } | |
142 | |
143 - (FARPROC) lpGetSupport = GetProcAddress( hASPI, "GetASPI32SupportInfo" ); | |
144 - (FARPROC) lpSendCommand = GetProcAddress( hASPI, "SendASPI32Command" ); | |
145 + lpGetSupport = (GETASPI32SUPPORTINFO) GetProcAddress( hASPI, "GetASPI32SupportInfo" ); | |
146 + lpSendCommand = (SENDASPI32COMMAND) GetProcAddress( hASPI, "SendASPI32Command" ); | |
147 | |
148 if(lpGetSupport == NULL || lpSendCommand == NULL ) | |
149 { | |
150 --- error.c 2003-03-10 01:15:31.000000000 +0100 | |
151 +++ error.c 2005-03-01 07:41:41.000000000 +0100 | |
152 @@ -25,16 +28,9 @@ | |
153 | 104 |
154 #include <stdio.h> | 105 #include <stdio.h> |
155 #include <stdlib.h> | 106 #include <stdlib.h> |
156 +#include <limits.h> | 107 - |
157 | 108 -#ifdef HAVE_SYS_PARAM_H |
158 -#ifdef HAVE_SYS_PARAM_H | 109 -# include <sys/param.h> |
159 -# include <sys/param.h> | 110 -#endif |
160 -#endif | 111 - |
161 - | 112 -#ifdef HAVE_LIMITS_H |
162 -#ifdef HAVE_LIMITS_H | 113 # include <limits.h> |
163 -# include <limits.h> | 114 -#endif |
164 -#endif | 115 |
165 - | 116 -#include "dvdcss/dvdcss.h" |
166 -#include "dvdcss/dvdcss.h" | 117 +#include "dvdcss.h" |
167 +#include "dvdcss.h" | 118 |
168 | 119 #include "common.h" |
169 #include "common.h" | 120 #include "css.h" |
170 #include "css.h" | 121 --- libdvdcss.c 2004-08-13 15:40:18.000000000 +0200 |
171 --- ioctl.c 2003-03-10 00:34:10.000000000 +0100 | 122 +++ libdvdcss.c 2005-10-01 19:11:27.000000000 +0200 |
172 +++ ioctl.c 2005-03-01 07:41:41.000000000 +0100 | 123 @@ -87,10 +87,7 @@ |
173 @@ -76,6 +79,7 @@ | |
174 # include <sys/scsi.h> | |
175 #endif | |
176 #ifdef SOLARIS_USCSI | |
177 +# include <dlfcn.h> | |
178 # include <unistd.h> | |
179 # include <stropts.h> | |
180 # include <sys/scsi/scsi_types.h> | |
181 @@ -112,6 +116,7 @@ | |
182 *****************************************************************************/ | |
183 #if defined( SOLARIS_USCSI ) | |
184 static void SolarisInitUSCSI( struct uscsi_cmd *p_sc, int i_type ); | |
185 +static int SolarisSendUSCSI( int fd, struct uscsi_cmd *p_sc ); | |
186 #endif | |
187 | |
188 /***************************************************************************** | |
189 @@ -192,7 +197,7 @@ | |
190 rs_cdb.cdb_opaque[ 6 ] = i_layer; | |
191 rs_cdb.cdb_opaque[ 7 ] = DVD_STRUCT_COPYRIGHT; | |
192 | |
193 - i_ret = ioctl(i_fd, USCSICMD, &sc); | |
194 + i_ret = SolarisSendUSCSI(i_fd, &sc); | |
195 | |
196 if( i_ret < 0 || sc.uscsi_status ) { | |
197 i_ret = -1; | |
198 @@ -351,7 +356,7 @@ | |
199 rs_cdb.cdb_opaque[ 7 ] = DVD_STRUCT_DISCKEY; | |
200 rs_cdb.cdb_opaque[ 10 ] = *pi_agid << 6; | |
201 | |
202 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
203 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
204 | |
205 if( i_ret < 0 || sc.uscsi_status ) | |
206 { | |
207 @@ -513,7 +518,7 @@ | |
208 rs_cdb.cdb_opaque[ 5 ] = ( i_pos ) & 0xff; | |
209 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_TITLE_KEY | (*pi_agid << 6); | |
210 | |
211 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
212 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
213 | |
214 if( i_ret < 0 || sc.uscsi_status ) | |
215 { | |
216 @@ -665,7 +670,7 @@ | |
217 | |
218 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_AGID | (*pi_agid << 6); | |
219 | |
220 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
221 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
222 | |
223 if( i_ret < 0 || sc.uscsi_status ) | |
224 { | |
225 @@ -787,7 +792,7 @@ | |
226 | |
227 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_CHALLENGE | (*pi_agid << 6); | |
228 | |
229 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
230 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
231 | |
232 if( i_ret < 0 || sc.uscsi_status ) | |
233 { | |
234 @@ -921,7 +926,7 @@ | |
235 | |
236 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_ASF; | |
237 | |
238 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
239 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
240 | |
241 if( i_ret < 0 || sc.uscsi_status ) | |
242 { | |
243 @@ -1054,7 +1059,7 @@ | |
244 | |
245 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_KEY1 | (*pi_agid << 6); | |
246 | |
247 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
248 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
249 | |
250 if( i_ret < 0 || sc.uscsi_status ) | |
251 { | |
252 @@ -1175,7 +1180,7 @@ | |
253 | |
254 rs_cdb.cdb_opaque[ 10 ] = DVD_INVALIDATE_AGID | (*pi_agid << 6); | |
255 | |
256 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
257 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
258 | |
259 if( i_ret < 0 || sc.uscsi_status ) | |
260 { | |
261 @@ -1299,7 +1304,7 @@ | |
262 p_buffer[ 1 ] = 0xe; | |
263 memcpy( p_buffer + 4, p_challenge, DVD_CHALLENGE_SIZE ); | |
264 | |
265 - if( ioctl( i_fd, USCSICMD, &sc ) < 0 || sc.uscsi_status ) | |
266 + if( SolarisSendUSCSI( i_fd, &sc ) < 0 || sc.uscsi_status ) | |
267 { | |
268 return -1; | |
269 } | |
270 @@ -1436,7 +1441,7 @@ | |
271 p_buffer[ 1 ] = 0xa; | |
272 memcpy( p_buffer + 4, p_key, DVD_KEY_SIZE ); | |
273 | |
274 - if( ioctl( i_fd, USCSICMD, &sc ) < 0 || sc.uscsi_status ) | |
275 + if( SolarisSendUSCSI( i_fd, &sc ) < 0 || sc.uscsi_status ) | |
276 { | |
277 return -1; | |
278 } | |
279 @@ -1578,7 +1583,7 @@ | |
280 | |
281 rs_cdb.cdb_opaque[ 10 ] = DVD_REPORT_RPC; | |
282 | |
283 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
284 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
285 | |
286 if( i_ret < 0 || sc.uscsi_status ) | |
287 { | |
288 @@ -1728,7 +1733,7 @@ | |
289 p_buffer[ 1 ] = 6; | |
290 p_buffer[ 4 ] = i_pdrc; | |
291 | |
292 - i_ret = ioctl( i_fd, USCSICMD, &sc ); | |
293 + i_ret = SolarisSendUSCSI( i_fd, &sc ); | |
294 | |
295 if( i_ret < 0 || sc.uscsi_status ) | |
296 { | |
297 @@ -1901,6 +1906,54 @@ | |
298 | |
299 USCSI_TIMEOUT( p_sc, 15 ); | |
300 } | |
301 + | |
302 +/***************************************************************************** | |
303 + * SolarisSendUSCSI: send a USCSICMD structure to the Solaris kernel | |
304 + * for execution | |
305 + ***************************************************************************** | |
306 + * When available, this function uses the function smedia_uscsi_cmd() | |
307 + * from solaris' libsmedia library (solaris 9 or newer) to execute the | |
308 + * USCSI command. smedia_uscsi_cmd() allows USCSI commands for | |
309 + * non-root users on removable media devices on solaris 9; sending the | |
310 + * USCSI command directly to the device using the USCSICMD ioctl fails | |
311 + * with an EPERM error on solaris 9. | |
312 + * | |
313 + * The code will fall back to the USCSICMD ioctl method, when | |
314 + * libsmedia.so is not available or does not export the | |
315 + * smedia_uscsi_cmd() function (on solaris releases upto and including | |
316 + * solaris 8). Fortunatelly, on these old releases non-root users are | |
317 + * allowed to perform USCSICMD ioctls on removable media devices. | |
318 + *****************************************************************************/ | |
319 +static int SolarisSendUSCSI( int i_fd, struct uscsi_cmd *p_sc ) { | |
320 + void *sm_hdl; | |
321 + static int initialized; | |
322 + static void* (*sm_get_handle)(int32_t); | |
323 + static int (*sm_release_handle)(void*); | |
324 + static int (*sm_uscsi_cmd)(void*, struct uscsi_cmd *); | |
325 + | |
326 + if (!initialized) | |
327 + { | |
328 + void *smedia_lib; | |
329 + | |
330 + smedia_lib = dlopen("libsmedia.so", RTLD_NOW); | |
331 + if (smedia_lib) { | |
332 + sm_get_handle = dlsym(smedia_lib, "smedia_get_handle"); | |
333 + sm_release_handle = dlsym(smedia_lib, "smedia_release_handle"); | |
334 + sm_uscsi_cmd = dlsym(smedia_lib, "smedia_uscsi_cmd"); | |
335 + } | |
336 + initialized = 1; | |
337 + } | |
338 + | |
339 + if (sm_get_handle && sm_uscsi_cmd && sm_release_handle | |
340 + && (sm_hdl = sm_get_handle(i_fd))) | |
341 + { | |
342 + int i_ret = sm_uscsi_cmd(sm_hdl, p_sc); | |
343 + sm_release_handle(sm_hdl); | |
344 + return i_ret; | |
345 + } | |
346 + | |
347 + return ioctl( i_fd, USCSICMD, p_sc ); | |
348 +} | |
349 #endif | |
350 | |
351 #if defined( WIN32 ) | |
352 --- libdvdcss.c 2003-06-22 16:08:53.000000000 +0200 | |
353 +++ libdvdcss.c 2005-03-01 07:41:41.000000000 +0100 | |
354 @@ -22,7 +25,7 @@ | |
355 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. | |
356 */ | |
357 | |
358 -/** | |
359 +/* | |
360 * \mainpage libdvdcss developer documentation | |
361 * | |
362 * \section intro Introduction | |
363 @@ -87,10 +90,7 @@ | |
364 * values. This will speed up descrambling of DVDs which are in the | 124 * values. This will speed up descrambling of DVDs which are in the |
365 * cache. The DVDCSS_CACHE directory is created if it does not exist, | 125 * cache. The DVDCSS_CACHE directory is created if it does not exist, |
366 * and a subdirectory is created named after the DVD's title or | 126 * and a subdirectory is created named after the DVD's title or |
367 - * manufacturing date. If DVDCSS_CACHE is not set or is empty, \e libdvdcss | 127 - * manufacturing date. If DVDCSS_CACHE is not set or is empty, \e libdvdcss |
368 - * will use the default value which is "${HOME}/.dvdcss/" under Unix and | 128 - * will use the default value which is "${HOME}/.dvdcss/" under Unix and |
370 - * The special value "off" disables caching. | 130 - * The special value "off" disables caching. |
371 + * manufacturing date. | 131 + * manufacturing date. |
372 */ | 132 */ |
373 | 133 |
374 /* | 134 /* |
375 @@ -103,28 +103,12 @@ | 135 @@ -103,28 +100,12 @@ |
376 #include <string.h> | 136 #include <string.h> |
377 #include <sys/types.h> | 137 #include <sys/types.h> |
378 #include <sys/stat.h> | 138 #include <sys/stat.h> |
379 -#ifdef HAVE_SYS_PARAM_H | 139 -#ifdef HAVE_SYS_PARAM_H |
380 -# include <sys/param.h> | 140 -# include <sys/param.h> |
382 -#ifdef HAVE_PWD_H | 142 -#ifdef HAVE_PWD_H |
383 -# include <pwd.h> | 143 -# include <pwd.h> |
384 -#endif | 144 -#endif |
385 #include <fcntl.h> | 145 #include <fcntl.h> |
386 #include <errno.h> | 146 #include <errno.h> |
387 +#include <unistd.h> | 147 - |
388 +#include <limits.h> | |
389 | |
390 -#ifdef HAVE_UNISTD_H | 148 -#ifdef HAVE_UNISTD_H |
391 -# include <unistd.h> | 149 # include <unistd.h> |
392 -#endif | 150 -#endif |
393 - | 151 - |
394 -#ifdef HAVE_LIMITS_H | 152 -#ifdef HAVE_LIMITS_H |
395 -# include <limits.h> | 153 # include <limits.h> |
396 -#endif | 154 -#endif |
397 - | 155 |
398 -#ifdef HAVE_DIRECT_H | 156 -#ifdef HAVE_DIRECT_H |
399 -# include <direct.h> | 157 -# include <direct.h> |
400 -#endif | 158 -#endif |
401 - | 159 - |
402 -#include "dvdcss/dvdcss.h" | 160 -#include "dvdcss/dvdcss.h" |
403 +#include "dvdcss.h" | 161 +#include "dvdcss.h" |
404 | 162 |
405 #include "common.h" | 163 #include "common.h" |
406 #include "css.h" | 164 #include "css.h" |
407 @@ -132,6 +116,12 @@ | 165 @@ -132,6 +113,12 @@ |
408 #include "ioctl.h" | 166 #include "ioctl.h" |
409 #include "device.h" | 167 #include "device.h" |
410 | 168 |
411 +#ifndef HAVE_MPLAYER | 169 +#ifndef HAVE_MPLAYER |
412 + #include "get_path.c" | 170 + #include "get_path.c" |
415 +#endif | 173 +#endif |
416 + | 174 + |
417 /** | 175 /** |
418 * \brief Symbol for version checks. | 176 * \brief Symbol for version checks. |
419 * | 177 * |
420 @@ -234,87 +224,11 @@ | 178 @@ -233,6 +220,8 @@ |
179 } | |
421 } | 180 } |
422 | 181 |
182 +#if 0 /* MPlayer caches keys in its own configuration directory */ | |
183 + | |
423 /* | 184 /* |
424 - * If DVDCSS_CACHE was not set, try to guess a default value | 185 * If DVDCSS_CACHE was not set, try to guess a default value |
425 - */ | 186 */ |
426 - if( psz_cache == NULL || psz_cache[0] == '\0' ) | 187 @@ -309,6 +298,8 @@ |
427 - { | 188 #endif |
428 -#ifdef HAVE_DIRECT_H | 189 } |
429 - typedef HRESULT( WINAPI *SHGETFOLDERPATH ) | 190 |
430 - ( HWND, int, HANDLE, DWORD, LPTSTR ); | 191 +#endif /* 0 */ |
431 - | 192 + |
432 -# define CSIDL_FLAG_CREATE 0x8000 | 193 /* |
433 -# define CSIDL_APPDATA 0x1A | |
434 -# define SHGFP_TYPE_CURRENT 0 | |
435 - | |
436 - char psz_home[MAX_PATH]; | |
437 - HINSTANCE p_dll; | |
438 - SHGETFOLDERPATH p_getpath; | |
439 - | |
440 - *psz_home = '\0'; | |
441 - | |
442 - /* Load the shfolder dll to retrieve SHGetFolderPath */ | |
443 - p_dll = LoadLibrary( "shfolder.dll" ); | |
444 - if( p_dll ) | |
445 - { | |
446 - p_getpath = (void*)GetProcAddress( p_dll, "SHGetFolderPathA" ); | |
447 - if( p_getpath ) | |
448 - { | |
449 - /* Get the "Application Data" folder for the current user */ | |
450 - if( p_getpath( NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, | |
451 - NULL, SHGFP_TYPE_CURRENT, psz_home ) == S_OK ) | |
452 - { | |
453 - FreeLibrary( p_dll ); | |
454 - } | |
455 - else | |
456 - { | |
457 - *psz_home = '\0'; | |
458 - } | |
459 - } | |
460 - FreeLibrary( p_dll ); | |
461 - } | |
462 - | |
463 - /* Cache our keys in | |
464 - * C:\Documents and Settings\$USER\Application Data\dvdcss\ */ | |
465 - if( *psz_home ) | |
466 - { | |
467 - snprintf( psz_buffer, PATH_MAX, "%s/dvdcss", psz_home ); | |
468 - psz_buffer[PATH_MAX-1] = '\0'; | |
469 - psz_cache = psz_buffer; | |
470 - } | |
471 -#else | |
472 - char *psz_home = NULL; | |
473 -# ifdef HAVE_PWD_H | |
474 - struct passwd *p_pwd; | |
475 - | |
476 - /* Try looking in password file for home dir. */ | |
477 - p_pwd = getpwuid(getuid()); | |
478 - if( p_pwd ) | |
479 - { | |
480 - psz_home = p_pwd->pw_dir; | |
481 - } | |
482 -# endif | |
483 - | |
484 - if( psz_home == NULL ) | |
485 - { | |
486 - psz_home = getenv( "HOME" ); | |
487 - } | |
488 - | |
489 - /* Cache our keys in ${HOME}/.dvdcss/ */ | |
490 - if( psz_home ) | |
491 - { | |
492 - snprintf( psz_buffer, PATH_MAX, "%s/.dvdcss", psz_home ); | |
493 - psz_buffer[PATH_MAX-1] = '\0'; | |
494 - psz_cache = psz_buffer; | |
495 - } | |
496 -#endif | |
497 - } | |
498 - | |
499 - /* | |
500 * Find cache dir from the DVDCSS_CACHE environment variable | 194 * Find cache dir from the DVDCSS_CACHE environment variable |
501 */ | 195 */ |
502 if( psz_cache != NULL ) | 196 @@ -326,6 +317,7 @@ |
503 { | |
504 - if( psz_cache[0] == '\0' || !strcmp( psz_cache, "off" ) ) | |
505 + if( psz_cache[0] == '\0' ) | |
506 { | |
507 psz_cache = NULL; | |
508 } | |
509 @@ -325,6 +239,7 @@ | |
510 psz_cache = NULL; | 197 psz_cache = NULL; |
511 } | 198 } |
512 } | 199 } |
513 + else psz_cache = get_path( "DVDKeys" ); | 200 + else psz_cache = get_path( "DVDKeys" ); |
514 | 201 |
515 /* | 202 /* |
516 * Open device | 203 * Open device |
517 @@ -465,9 +380,10 @@ | 204 @@ -504,9 +496,10 @@ |
518 dvdcss->psz_cachefile[0] = '\0'; | 205 dvdcss->psz_cachefile[0] = '\0'; |
519 goto nocache; | 206 goto nocache; |
520 } | 207 } |
521 + i += sprintf( dvdcss->psz_cachefile + i, "/"); | 208 + i += sprintf( dvdcss->psz_cachefile + i, "/"); |
522 | 209 |
523 - i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, | 210 - i += sprintf( dvdcss->psz_cachefile + i, "/%s-%s%s", psz_title, |
524 - psz_serial ); | 211 - psz_serial, psz_key ); |
525 +// i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data ); | 212 +// i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data ); |
526 + i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, psz_serial ); | 213 + i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, psz_serial ); |
527 #if !defined( WIN32 ) || defined( SYS_CYGWIN ) | 214 #if !defined( WIN32 ) || defined( SYS_CYGWIN ) |
528 i_ret = mkdir( dvdcss->psz_cachefile, 0755 ); | 215 i_ret = mkdir( dvdcss->psz_cachefile, 0755 ); |
529 #else | 216 #else |
530 --- dvdcss/dvdcss.h 2003-04-18 20:05:36.000000000 +0200 | |
531 +++ dvdcss.h 2005-03-01 07:41:41.000000000 +0100 | |
532 @@ -67,6 +70,8 @@ | |
533 */ | |
534 extern dvdcss_t dvdcss_open ( char *psz_target ); | |
535 extern int dvdcss_close ( dvdcss_t ); | |
536 +extern int dvdcss_title ( dvdcss_t, | |
537 + int i_block ); | |
538 extern int dvdcss_seek ( dvdcss_t, | |
539 int i_blocks, | |
540 int i_flags ); | |
541 --- dvdcss/ioctl.h 2005-06-07 19:22:40.187852752 +0200 | |
542 +++ ioctl.h 2005-06-07 15:31:43.000000000 +0200 | |
543 @@ -318,6 +318,9 @@ | |
544 * win32 aspi specific | |
545 *****************************************************************************/ | |
546 | |
547 +typedef WINAPI DWORD (*GETASPI32SUPPORTINFO)(VOID); | |
548 +typedef WINAPI DWORD (*SENDASPI32COMMAND)(LPVOID); | |
549 + | |
550 #define WIN2K ( GetVersion() < 0x80000000 ) | |
551 #define ASPI_HAID 0 | |
552 #define ASPI_TARGET 0 | |
553 @@ -339,7 +342,7 @@ | |
554 long hASPI; | |
555 short i_sid; | |
556 int i_blocks; | |
557 - long (*lpSendCommand)( void* ); | |
558 + SENDASPI32COMMAND lpSendCommand; | |
559 }; | |
560 | |
561 #pragma pack(1) |