14861
|
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
|
|
13 +++ common.h 2005-03-01 07:41:41.000000000 +0100
|
|
14 @@ -27,21 +30,10 @@
|
|
15 /*****************************************************************************
|
|
16 * Basic types definitions
|
|
17 *****************************************************************************/
|
|
18 -#if defined( HAVE_STDINT_H )
|
|
19 -# include <stdint.h>
|
|
20 -#elif defined( HAVE_INTTYPES_H )
|
|
21 -# include <inttypes.h>
|
|
22 -#elif defined( SYS_CYGWIN )
|
|
23 -# include <sys/types.h>
|
|
24 - /* Cygwin only defines half of these... */
|
|
25 - typedef u_int8_t uint8_t;
|
|
26 - typedef u_int32_t uint32_t;
|
|
27 -#else
|
|
28 - /* Fallback types (very x86-centric, sorry) */
|
|
29 - typedef unsigned char uint8_t;
|
|
30 - typedef signed char int8_t;
|
|
31 - typedef unsigned int uint32_t;
|
|
32 - typedef signed int int32_t;
|
|
33 +#include <inttypes.h>
|
|
34 +
|
|
35 +#ifdef __CYGWIN__
|
|
36 +#define SYS_CYGWIN
|
|
37 #endif
|
|
38
|
|
39 #if defined( WIN32 )
|
|
40 --- css.c 2003-07-29 01:37:06.000000000 +0200
|
|
41 +++ css.c 2005-03-01 07:41:41.000000000 +0100
|
|
42 @@ -40,19 +43,11 @@
|
|
43 #include <string.h>
|
|
44 #include <sys/types.h>
|
|
45 #include <sys/stat.h>
|
|
46 -#ifdef HAVE_SYS_PARAM_H
|
|
47 -# include <sys/param.h>
|
|
48 -#endif
|
|
49 -#ifdef HAVE_UNISTD_H
|
|
50 -# include <unistd.h>
|
|
51 -#endif
|
|
52 #include <fcntl.h>
|
|
53 +#include <unistd.h>
|
|
54 +#include <limits.h>
|
|
55
|
|
56 -#ifdef HAVE_LIMITS_H
|
|
57 -# include <limits.h>
|
|
58 -#endif
|
|
59 -
|
|
60 -#include "dvdcss/dvdcss.h"
|
|
61 +#include "dvdcss.h"
|
|
62
|
|
63 #include "common.h"
|
|
64 #include "css.h"
|
15692
|
65 --- dvdcss/device.c 2005-06-07 19:22:40.181853664 +0200
|
|
66 +++ device.c 2005-06-07 15:36:21.000000000 +0200
|
14861
|
67 @@ -33,18 +36,9 @@
|
|
68 #include <string.h>
|
|
69 #include <sys/types.h>
|
|
70 #include <sys/stat.h>
|
|
71 -#ifdef HAVE_SYS_PARAM_H
|
|
72 -# include <sys/param.h>
|
|
73 -#endif
|
|
74 #include <fcntl.h>
|
|
75 -
|
|
76 -#ifdef HAVE_UNISTD_H
|
|
77 -# include <unistd.h>
|
|
78 -#endif
|
|
79 -
|
|
80 -#ifdef HAVE_LIMITS_H
|
|
81 -# include <limits.h>
|
|
82 -#endif
|
|
83 +#include <unistd.h>
|
|
84 +#include <limits.h>
|
|
85
|
|
86 #if defined( WIN32 ) && !defined( SYS_CYGWIN )
|
|
87 # include <io.h> /* read() */
|
|
88 @@ -52,7 +46,7 @@
|
|
89 # include <sys/uio.h> /* struct iovec */
|
|
90 #endif
|
|
91
|
|
92 -#include "dvdcss/dvdcss.h"
|
|
93 +#include "dvdcss.h"
|
|
94
|
|
95 #include "common.h"
|
|
96 #include "css.h"
|
|
97 @@ -143,8 +137,11 @@
|
|
98 _dvdcss_debug( dvdcss, psz_debug );
|
|
99
|
|
100 #if defined( WIN32 )
|
|
101 - /* If device is not "X:", we are actually opening a file. */
|
|
102 - dvdcss->b_file = !psz_device[0] || psz_device[1] != ':' || psz_device[2];
|
|
103 + dvdcss->b_file = 1;
|
|
104 + /* If device is "X:" or "X:\", we are not actually opening a file. */
|
|
105 + if (psz_device[0] && psz_device[1] == ':' &&
|
|
106 + (!psz_device[2] || (psz_device[2] == '\\' && !psz_device[3])))
|
|
107 + dvdcss->b_file = 0;
|
|
108
|
|
109 /* Initialize readv temporary buffer */
|
|
110 dvdcss->p_readv_buffer = NULL;
|
15692
|
111 @@ -276,14 +273,14 @@
|
|
112 * won't send back the right result).
|
|
113 * (See Microsoft Q241374: Read and Write Access Required for SCSI
|
|
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 {
|
14861
|
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
|
|
154 #include <stdio.h>
|
|
155 #include <stdlib.h>
|
|
156 +#include <limits.h>
|
|
157
|
|
158 -#ifdef HAVE_SYS_PARAM_H
|
|
159 -# include <sys/param.h>
|
|
160 -#endif
|
|
161 -
|
|
162 -#ifdef HAVE_LIMITS_H
|
|
163 -# include <limits.h>
|
|
164 -#endif
|
|
165 -
|
|
166 -#include "dvdcss/dvdcss.h"
|
|
167 +#include "dvdcss.h"
|
|
168
|
|
169 #include "common.h"
|
|
170 #include "css.h"
|
|
171 --- ioctl.c 2003-03-10 00:34:10.000000000 +0100
|
|
172 +++ ioctl.c 2005-03-01 07:41:41.000000000 +0100
|
|
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
|
|
365 * 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
|
|
367 - * 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
|
|
369 - * "C:\Documents and Settings\$USER\Application Data\dvdcss\" under Win32.
|
|
370 - * The special value "off" disables caching.
|
|
371 + * manufacturing date.
|
|
372 */
|
|
373
|
|
374 /*
|
|
375 @@ -103,28 +103,12 @@
|
|
376 #include <string.h>
|
|
377 #include <sys/types.h>
|
|
378 #include <sys/stat.h>
|
|
379 -#ifdef HAVE_SYS_PARAM_H
|
|
380 -# include <sys/param.h>
|
|
381 -#endif
|
|
382 -#ifdef HAVE_PWD_H
|
|
383 -# include <pwd.h>
|
|
384 -#endif
|
|
385 #include <fcntl.h>
|
|
386 #include <errno.h>
|
|
387 +#include <unistd.h>
|
|
388 +#include <limits.h>
|
|
389
|
|
390 -#ifdef HAVE_UNISTD_H
|
|
391 -# include <unistd.h>
|
|
392 -#endif
|
|
393 -
|
|
394 -#ifdef HAVE_LIMITS_H
|
|
395 -# include <limits.h>
|
|
396 -#endif
|
|
397 -
|
|
398 -#ifdef HAVE_DIRECT_H
|
|
399 -# include <direct.h>
|
|
400 -#endif
|
|
401 -
|
|
402 -#include "dvdcss/dvdcss.h"
|
|
403 +#include "dvdcss.h"
|
|
404
|
|
405 #include "common.h"
|
|
406 #include "css.h"
|
|
407 @@ -132,6 +116,12 @@
|
|
408 #include "ioctl.h"
|
|
409 #include "device.h"
|
|
410
|
|
411 +#ifndef HAVE_MPLAYER
|
|
412 + #include "get_path.c"
|
|
413 +#else
|
|
414 + extern char * get_path( char * filename );
|
|
415 +#endif
|
|
416 +
|
|
417 /**
|
|
418 * \brief Symbol for version checks.
|
|
419 *
|
|
420 @@ -234,87 +224,11 @@
|
|
421 }
|
|
422
|
|
423 /*
|
|
424 - * If DVDCSS_CACHE was not set, try to guess a default value
|
|
425 - */
|
|
426 - if( psz_cache == NULL || psz_cache[0] == '\0' )
|
|
427 - {
|
|
428 -#ifdef HAVE_DIRECT_H
|
|
429 - typedef HRESULT( WINAPI *SHGETFOLDERPATH )
|
|
430 - ( HWND, int, HANDLE, DWORD, LPTSTR );
|
|
431 -
|
|
432 -# define CSIDL_FLAG_CREATE 0x8000
|
|
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
|
|
501 */
|
|
502 if( psz_cache != NULL )
|
|
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;
|
|
511 }
|
|
512 }
|
|
513 + else psz_cache = get_path( "DVDKeys" );
|
|
514
|
|
515 /*
|
|
516 * Open device
|
|
517 @@ -465,9 +380,10 @@
|
|
518 dvdcss->psz_cachefile[0] = '\0';
|
|
519 goto nocache;
|
|
520 }
|
|
521 + i += sprintf( dvdcss->psz_cachefile + i, "/");
|
|
522
|
|
523 - i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title,
|
|
524 - psz_serial );
|
|
525 +// i += sprintf( dvdcss->psz_cachefile + i, "/%s", psz_data );
|
|
526 + i += sprintf( dvdcss->psz_cachefile + i, "/%s#%s", psz_title, psz_serial );
|
|
527 #if !defined( WIN32 ) || defined( SYS_CYGWIN )
|
|
528 i_ret = mkdir( dvdcss->psz_cachefile, 0755 );
|
|
529 #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 );
|
15692
|
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)
|