annotate libmpdvdkit2/libdvdcss_changes.diff @ 14967:d901658f487d

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