annotate libmpdvdkit2/libdvdcss_changes.diff @ 15359:af245d15f502

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