Mercurial > mplayer.hg
annotate libmpdvdkit2/libdvdcss.c @ 9051:da9d39c59294
bunkus: Fixed and updated the translations
author | mosu |
---|---|
date | Tue, 21 Jan 2003 10:42:18 +0000 |
parents | ddf6a9f4cc6a |
children | f0f0f176d298 |
rev | line source |
---|---|
7027 | 1 /* libdvdcss.c: DVD reading library. |
2 * | |
3 * Authors: Stéphane Borel <stef@via.ecp.fr> | |
4 * Samuel Hocevar <sam@zoy.org> | |
5 * Håkan Hjort <d95hjort@dtek.chalmers.se> | |
6 * | |
7 * Copyright (C) 1998-2002 VideoLAN | |
8 * $Id$ | |
9 * | |
10 * This program is free software; you can redistribute it and/or modify | |
11 * it under the terms of the GNU General Public License as published by | |
12 * the Free Software Foundation; either version 2 of the License, or | |
13 * (at your option) any later version. | |
14 * | |
15 * This program is distributed in the hope that it will be useful, | |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 * GNU General Public License for more details. | |
19 * | |
20 * You should have received a copy of the GNU General Public License | |
21 * along with this program; if not, write to the Free Software | |
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. | |
23 */ | |
24 | |
25 /** | |
26 * \mainpage libdvdcss developer documentation | |
27 * | |
28 * \section intro Introduction | |
29 * | |
30 * \e libdvdcss is a simple library designed for accessing DVDs like a block | |
31 * device without having to bother about the decryption. The important features | |
32 * are: | |
33 * \li portability: currently supported platforms are GNU/Linux, FreeBSD, | |
34 * NetBSD, OpenBSD, BSD/OS, BeOS, Windows 95/98, Windows NT/2000, MacOS X, | |
35 * Solaris, HP-UX and OS/2. | |
36 * \li adaptability: unlike most similar projects, libdvdcss doesn't require | |
37 * the region of your drive to be set and will try its best to read from | |
38 * the disc even in the case of a region mismatch. | |
39 * \li simplicity: a DVD player can be built around the \e libdvdcss API using | |
40 * no more than 4 or 5 library calls. | |
41 * | |
42 * \e libdvdcss is free software, released under the General Public License. | |
43 * This ensures that \e libdvdcss remains free and used only with free | |
44 * software. | |
45 * | |
46 * \section api The libdvdcss API | |
47 * | |
48 * The complete \e libdvdcss programming interface is documented in the | |
49 * dvdcss.h file. | |
50 * | |
51 * \section env Environment variables | |
52 * | |
53 * Some environment variables can be used to change the behaviour of | |
54 * \e libdvdcss without having to modify the program which uses it. These | |
55 * variables are: | |
56 * | |
57 * \li \b DVDCSS_VERBOSE: sets the verbosity level. | |
58 * - \c 0 outputs no messages at all. | |
59 * - \c 1 outputs error messages to stderr. | |
60 * - \c 2 outputs error messages and debug messages to stderr. | |
61 * | |
62 * \li \b DVDCSS_METHOD: sets the authentication and decryption method | |
63 * that \e libdvdcss will use to read scrambled discs. Can be one | |
64 * of \c title, \c key or \c disc. | |
65 * - \c key is the default method. \e libdvdcss will use a set of | |
66 * calculated player keys to try and get the disc key. This can fail | |
67 * if the drive does not recognize any of the player keys. | |
68 * - \c disc is a fallback method when \c key has failed. Instead of | |
69 * using player keys, \e libdvdcss will crack the disc key using | |
70 * a brute force algorithm. This process is CPU intensive and requires | |
71 * 64 MB of memory to store temporary data. | |
72 * - \c title is the fallback when all other methods have failed. It does | |
73 * not rely on a key exchange with the DVD drive, but rather uses a | |
74 * crypto attack to guess the title key. On rare cases this may fail | |
75 * because there is not enough encrypted data on the disc to perform | |
76 * a statistical attack, but in the other hand it is the only way to | |
77 * decrypt a DVD stored on a hard disc, or a DVD with the wrong region | |
78 * on an RPC2 drive. | |
79 * | |
80 * \li \b DVDCSS_RAW_DEVICE: specify the raw device to use. | |
81 * | |
82 */ | |
83 | |
84 /* | |
85 * Preamble | |
86 */ | |
87 #include "config.h" | |
88 | |
89 #include <stdio.h> | |
90 #include <stdlib.h> | |
91 #include <string.h> | |
92 #include <sys/types.h> | |
93 #include <sys/stat.h> | |
94 #include <fcntl.h> | |
95 | |
96 #ifdef HAVE_UNISTD_H | |
97 # include <unistd.h> | |
98 #endif | |
99 | |
7033 | 100 #include "dvdcss.h" |
7027 | 101 |
102 #include "common.h" | |
103 #include "css.h" | |
104 #include "libdvdcss.h" | |
105 #include "ioctl.h" | |
106 #include "device.h" | |
107 | |
108 /** | |
109 * \brief Symbol for version checks. | |
110 * | |
111 * The name of this symbol contains the library major number, which makes it | |
112 * easy to check which \e libdvdcss development headers are installed on the | |
113 * system with tools such as autoconf. | |
114 * | |
115 * The variable itself contains the exact version number of the library, | |
116 * which can be useful for specific feature needs. | |
117 */ | |
118 char * dvdcss_interface_2 = VERSION; | |
119 | |
7032 | 120 char * dvdcss_cache_dir = NULL; |
121 | |
7027 | 122 /** |
123 * \brief Open a DVD device or directory and return a dvdcss instance. | |
124 * | |
125 * \param psz_target a string containing the target name, for instance | |
126 * "/dev/hdc" or "E:". | |
127 * \return a handle to a dvdcss instance or NULL on error. | |
128 * | |
129 * Initialize the \e libdvdcss library and open the requested DVD device or | |
130 * directory. \e libdvdcss checks whether ioctls can be performed on the disc, | |
131 * and when possible, the disc key is retrieved. | |
132 * | |
133 * dvdcss_open() returns a handle to be used for all subsequent \e libdvdcss | |
134 * calls. If an error occured, NULL is returned. | |
135 */ | |
136 extern dvdcss_t dvdcss_open ( char *psz_target ) | |
137 { | |
138 int i_ret; | |
139 | |
140 char *psz_method = getenv( "DVDCSS_METHOD" ); | |
141 char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); | |
142 #ifndef WIN32 | |
143 char *psz_raw_device = getenv( "DVDCSS_RAW_DEVICE" ); | |
144 #endif | |
145 | |
146 dvdcss_t dvdcss; | |
147 | |
148 /* | |
149 * Allocate the library structure | |
150 */ | |
151 dvdcss = malloc( sizeof( struct dvdcss_s ) ); | |
152 if( dvdcss == NULL ) | |
153 { | |
154 return NULL; | |
155 } | |
156 | |
157 /* | |
158 * Initialize structure with default values | |
159 */ | |
160 #ifndef WIN32 | |
161 dvdcss->i_raw_fd = -1; | |
162 #endif | |
163 dvdcss->p_titles = NULL; | |
164 dvdcss->psz_device = (char *)strdup( psz_target ); | |
165 dvdcss->psz_error = "no error"; | |
166 dvdcss->i_method = DVDCSS_METHOD_KEY; | |
167 dvdcss->b_debug = 0; | |
168 dvdcss->b_errors = 0; | |
7032 | 169 dvdcss->psz_cache = NULL; |
7027 | 170 |
171 /* | |
172 * Find verbosity from DVDCSS_VERBOSE environment variable | |
173 */ | |
174 if( psz_verbose != NULL ) | |
175 { | |
176 switch( atoi( psz_verbose ) ) | |
177 { | |
178 case 2: | |
179 dvdcss->b_debug = 1; | |
180 case 1: | |
181 dvdcss->b_errors = 1; | |
182 case 0: | |
183 break; | |
184 } | |
185 } | |
186 | |
187 /* | |
188 * Find method from DVDCSS_METHOD environment variable | |
189 */ | |
190 if( psz_method != NULL ) | |
191 { | |
192 if( !strncmp( psz_method, "key", 4 ) ) | |
193 { | |
194 dvdcss->i_method = DVDCSS_METHOD_KEY; | |
195 } | |
196 else if( !strncmp( psz_method, "disc", 5 ) ) | |
197 { | |
198 dvdcss->i_method = DVDCSS_METHOD_DISC; | |
199 } | |
200 else if( !strncmp( psz_method, "title", 5 ) ) | |
201 { | |
202 dvdcss->i_method = DVDCSS_METHOD_TITLE; | |
203 } | |
204 else | |
205 { | |
206 _dvdcss_error( dvdcss, "unknown decrypt method, please choose " | |
207 "from 'title', 'key' or 'disc'" ); | |
208 free( dvdcss->psz_device ); | |
209 free( dvdcss ); | |
210 return NULL; | |
211 } | |
212 } | |
213 | |
7032 | 214 if(!dvdcss_cache_dir) dvdcss_cache_dir = getenv( "DVDCSS_CACHE" ); |
215 | |
7027 | 216 /* |
217 * Open device | |
218 */ | |
219 i_ret = _dvdcss_open( dvdcss ); | |
220 if( i_ret < 0 ) | |
221 { | |
222 free( dvdcss->psz_device ); | |
223 free( dvdcss ); | |
224 return NULL; | |
225 } | |
226 | |
227 dvdcss->b_scrambled = 1; /* Assume the worst */ | |
228 dvdcss->b_ioctls = _dvdcss_use_ioctls( dvdcss ); | |
229 | |
230 if( dvdcss->b_ioctls ) | |
231 { | |
232 i_ret = _dvdcss_test( dvdcss ); | |
233 if( i_ret < 0 ) | |
234 { | |
235 /* Disable the CSS ioctls and hope that it works? */ | |
236 _dvdcss_debug( dvdcss, | |
237 "could not check whether the disc was scrambled" ); | |
238 dvdcss->b_ioctls = 0; | |
239 } | |
240 else | |
241 { | |
242 _dvdcss_debug( dvdcss, i_ret ? "disc is scrambled" | |
243 : "disc is unscrambled" ); | |
244 dvdcss->b_scrambled = i_ret; | |
245 } | |
246 } | |
247 | |
248 /* If disc is CSS protected and the ioctls work, authenticate the drive */ | |
249 if( dvdcss->b_scrambled && dvdcss->b_ioctls ) | |
250 { | |
251 i_ret = _dvdcss_disckey( dvdcss ); | |
252 | |
253 if( i_ret < 0 ) | |
254 { | |
255 _dvdcss_close( dvdcss ); | |
256 free( dvdcss->psz_device ); | |
257 free( dvdcss ); | |
258 return NULL; | |
259 } | |
260 } | |
261 | |
262 #ifndef WIN32 | |
263 if( psz_raw_device != NULL ) | |
264 { | |
265 _dvdcss_raw_open( dvdcss, psz_raw_device ); | |
266 } | |
267 #endif | |
268 | |
7032 | 269 /* if the CACHE is enabled, extract some unique disc ID */ |
270 if(dvdcss_cache_dir){ | |
271 char* disc_id=NULL; | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7033
diff
changeset
|
272 /*char title_name[64];*/ |
7032 | 273 char sector[DVDCSS_BLOCK_SIZE]; |
274 // 32768+40 -> disc title (32 uppercase chars) | |
275 // 32768+813 -> disc manufacturing date + serial no (16 digit number) | |
8841 | 276 int ret=dvdcss->pf_seek( dvdcss, 32768/DVDCSS_BLOCK_SIZE); |
277 //printf("disc_id seek: %d -> %d, i_fd=%d i_read_fd=%d\n",32768/DVDCSS_BLOCK_SIZE,ret,dvdcss->i_fd,dvdcss->i_read_fd); | |
8637
0211de3039eb
update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents:
8123
diff
changeset
|
278 if(dvdcss->pf_read( dvdcss, sector, 1) == 1){ |
7032 | 279 // check disc title first: |
280 char* title_name=§or[40]; | |
8841 | 281 int i=0; |
282 while(i<32 && title_name[i]>='0' && title_name[i]<='z') i++; | |
283 title_name[i]=0; | |
284 if(i>5){ | |
7032 | 285 disc_id=strdup(title_name); |
286 } else { | |
287 // use disc date+serial: | |
288 title_name=§or[813]; | |
289 title_name[16]=0; | |
290 for ( i=0;i<16;i++ ) | |
291 if ( ( title_name[i] < '0' )||( title_name[i] > '9' ) ){ | |
292 disc_id=malloc(16+4); | |
8638
a2fa276b8ec7
The attached patch fixes a crash on *my* environment with certain DVD's.
arpi
parents:
8637
diff
changeset
|
293 snprintf( disc_id,17,"%.2X%.2X%.2X%.2X%.2X%.2X%.2X%.2X",title_name[0],title_name[1],title_name[2],title_name[3],title_name[4],title_name[5],title_name[6],title_name[7] ); |
7032 | 294 break; |
295 } | |
296 if(!disc_id) disc_id=strdup(title_name); | |
297 } | |
298 if(disc_id){ | |
299 // yeah, we have a disc name/id, let's set up cache path: | |
8123
9fc45fe0d444
*HUGE* set of compiler warning fixes, unused variables removal
arpi
parents:
7033
diff
changeset
|
300 /*char* dir;*/ |
7032 | 301 dvdcss->psz_cache = malloc(strlen(dvdcss_cache_dir)+strlen(disc_id)+4); |
302 sprintf(dvdcss->psz_cache,"%s/%s",dvdcss_cache_dir,disc_id); | |
303 mkdir( dvdcss->psz_cache,493 ); | |
304 free(disc_id); | |
305 fprintf(stderr,"Using CSS Key-cache dir: %s\n",dvdcss->psz_cache); | |
306 } | |
307 } | |
308 } | |
309 | |
7027 | 310 return dvdcss; |
311 } | |
312 | |
313 /** | |
314 * \brief Return a string containing the latest error that occured in the | |
315 * given \e libdvdcss instance. | |
316 * | |
317 * \param dvdcss a \e libdvdcss instance. | |
318 * \return a null-terminated string containing the latest error message. | |
319 * | |
320 * This function returns a constant string containing the latest error that | |
321 * occured in \e libdvdcss. It can be used to format error messages at your | |
322 * convenience in your application. | |
323 */ | |
324 extern char * dvdcss_error ( dvdcss_t dvdcss ) | |
325 { | |
326 return dvdcss->psz_error; | |
327 } | |
328 | |
329 /** | |
330 * \brief Seek in the disc and change the current key if requested. | |
331 * | |
332 * \param dvdcss a \e libdvdcss instance. | |
333 * \param i_blocks an absolute block offset to seek to. | |
334 * \param i_flags #DVDCSS_NOFLAGS, optionally ored with one of #DVDCSS_SEEK_KEY | |
335 * or #DVDCSS_SEEK_MPEG. | |
336 * \return the new position in blocks, or a negative value in case an error | |
337 * happened. | |
338 * | |
339 * This function seeks to the requested position, in logical blocks. | |
340 * | |
341 * You typically set \p i_flags to #DVDCSS_NOFLAGS when seeking in a .IFO. | |
342 * | |
343 * If #DVDCSS_SEEK_MPEG is specified in \p i_flags and if \e libdvdcss finds it | |
344 * reasonable to do so (ie, if the dvdcss method is not "title"), the current | |
345 * title key will be checked and a new one will be calculated if necessary. | |
346 * This flag is typically used when reading data from a VOB. | |
347 * | |
348 * If #DVDCSS_SEEK_KEY is specified, the title key will be always checked, | |
349 * even with the "title" method. This is equivalent to using the now | |
350 * deprecated dvdcss_title() call. This flag is typically used when seeking | |
351 * in a new title. | |
352 */ | |
353 extern int dvdcss_seek ( dvdcss_t dvdcss, int i_blocks, int i_flags ) | |
354 { | |
355 /* title cracking method is too slow to be used at each seek */ | |
356 if( ( ( i_flags & DVDCSS_SEEK_MPEG ) | |
357 && ( dvdcss->i_method != DVDCSS_METHOD_TITLE ) ) | |
358 || ( i_flags & DVDCSS_SEEK_KEY ) ) | |
359 { | |
360 /* check the title key */ | |
361 if( _dvdcss_title( dvdcss, i_blocks ) ) | |
362 { | |
363 return -1; | |
364 } | |
365 } | |
366 | |
8637
0211de3039eb
update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents:
8123
diff
changeset
|
367 return dvdcss->pf_seek( dvdcss, i_blocks ); |
7027 | 368 } |
369 | |
370 /** | |
371 * \brief Read from the disc and decrypt data if requested. | |
372 * | |
373 * \param dvdcss a \e libdvdcss instance. | |
374 * \param p_buffer a buffer that will contain the data read from the disc. | |
375 * \param i_blocks the amount of blocks to read. | |
376 * \param i_flags #DVDCSS_NOFLAGS, optionally ored with #DVDCSS_READ_DECRYPT. | |
377 * \return the amount of blocks read, or a negative value in case an | |
378 * error happened. | |
379 * | |
380 * This function reads \p i_blocks logical blocks from the DVD. | |
381 * | |
382 * You typically set \p i_flags to #DVDCSS_NOFLAGS when reading data from a | |
383 * .IFO file on the DVD. | |
384 * | |
385 * If #DVDCSS_READ_DECRYPT is specified in \p i_flags, dvdcss_read() will | |
386 * automatically decrypt scrambled sectors. This flag is typically used when | |
387 * reading data from a .VOB file on the DVD. It has no effect on unscrambled | |
388 * discs or unscrambled sectors, and can be safely used on those. | |
389 * | |
390 * \warning dvdcss_read() expects to be able to write \p i_blocks * | |
391 * #DVDCSS_BLOCK_SIZE bytes in \p p_buffer. | |
392 */ | |
393 extern int dvdcss_read ( dvdcss_t dvdcss, void *p_buffer, | |
394 int i_blocks, | |
395 int i_flags ) | |
396 { | |
397 int i_ret, i_index; | |
398 | |
8637
0211de3039eb
update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents:
8123
diff
changeset
|
399 i_ret = dvdcss->pf_read( dvdcss, p_buffer, i_blocks ); |
7027 | 400 |
401 if( i_ret <= 0 | |
402 || !dvdcss->b_scrambled | |
403 || !(i_flags & DVDCSS_READ_DECRYPT) ) | |
404 { | |
405 return i_ret; | |
406 } | |
407 | |
408 if( ! memcmp( dvdcss->css.p_title_key, "\0\0\0\0\0", 5 ) ) | |
409 { | |
410 /* For what we believe is an unencrypted title, | |
411 * check that there are no encrypted blocks */ | |
412 for( i_index = i_ret; i_index; i_index-- ) | |
413 { | |
414 if( ((u8*)p_buffer)[0x14] & 0x30 ) | |
415 { | |
416 _dvdcss_error( dvdcss, "no key but found encrypted block" ); | |
417 /* Only return the initial range of unscrambled blocks? */ | |
418 /* or fail completely? return 0; */ | |
419 break; | |
420 } | |
421 p_buffer = (void *) ((u8 *)p_buffer + DVDCSS_BLOCK_SIZE); | |
422 } | |
423 } | |
424 else | |
425 { | |
426 /* Decrypt the blocks we managed to read */ | |
427 for( i_index = i_ret; i_index; i_index-- ) | |
428 { | |
429 _dvdcss_unscramble( dvdcss->css.p_title_key, p_buffer ); | |
430 ((u8*)p_buffer)[0x14] &= 0x8f; | |
431 p_buffer = (void *) ((u8 *)p_buffer + DVDCSS_BLOCK_SIZE); | |
432 } | |
433 } | |
434 | |
435 return i_ret; | |
436 } | |
437 | |
438 /** | |
439 * \brief Read from the disc into multiple buffers and decrypt data if | |
440 * requested. | |
441 * | |
442 * \param dvdcss a \e libdvdcss instance. | |
443 * \param p_iovec a pointer to an array of iovec structures that will contain | |
444 * the data read from the disc. | |
445 * \param i_blocks the amount of blocks to read. | |
446 * \param i_flags #DVDCSS_NOFLAGS, optionally ored with #DVDCSS_READ_DECRYPT. | |
447 * \return the amount of blocks read, or a negative value in case an | |
448 * error happened. | |
449 * | |
450 * This function reads \p i_blocks logical blocks from the DVD and writes them | |
451 * to an array of iovec structures. | |
452 * | |
453 * You typically set \p i_flags to #DVDCSS_NOFLAGS when reading data from a | |
454 * .IFO file on the DVD. | |
455 * | |
456 * If #DVDCSS_READ_DECRYPT is specified in \p i_flags, dvdcss_readv() will | |
457 * automatically decrypt scrambled sectors. This flag is typically used when | |
458 * reading data from a .VOB file on the DVD. It has no effect on unscrambled | |
459 * discs or unscrambled sectors, and can be safely used on those. | |
460 * | |
461 * \warning dvdcss_readv() expects to be able to write \p i_blocks * | |
462 * #DVDCSS_BLOCK_SIZE bytes in the buffers pointed by \p p_iovec. | |
463 * Moreover, all iov_len members of the iovec structures should be | |
464 * multiples of #DVDCSS_BLOCK_SIZE. | |
465 */ | |
466 extern int dvdcss_readv ( dvdcss_t dvdcss, void *p_iovec, | |
467 int i_blocks, | |
468 int i_flags ) | |
469 { | |
470 struct iovec *_p_iovec = (struct iovec *)p_iovec; | |
471 int i_ret, i_index; | |
472 void *iov_base; | |
473 size_t iov_len; | |
474 | |
8637
0211de3039eb
update libdvdcss in libmpdvdkit to latest version (1.2.4)
arpi
parents:
8123
diff
changeset
|
475 i_ret = dvdcss->pf_readv( dvdcss, _p_iovec, i_blocks ); |
7027 | 476 |
477 if( i_ret <= 0 | |
478 || !dvdcss->b_scrambled | |
479 || !(i_flags & DVDCSS_READ_DECRYPT) ) | |
480 { | |
481 return i_ret; | |
482 } | |
483 | |
484 /* Initialize loop for decryption */ | |
485 iov_base = _p_iovec->iov_base; | |
486 iov_len = _p_iovec->iov_len; | |
487 | |
488 /* Decrypt the blocks we managed to read */ | |
489 for( i_index = i_ret; i_index; i_index-- ) | |
490 { | |
491 /* Check that iov_len is a multiple of 2048 */ | |
492 if( iov_len & 0x7ff ) | |
493 { | |
494 return -1; | |
495 } | |
496 | |
497 while( iov_len == 0 ) | |
498 { | |
499 _p_iovec++; | |
500 iov_base = _p_iovec->iov_base; | |
501 iov_len = _p_iovec->iov_len; | |
502 } | |
503 | |
504 _dvdcss_unscramble( dvdcss->css.p_title_key, iov_base ); | |
505 ((u8*)iov_base)[0x14] &= 0x8f; | |
506 | |
507 iov_base = (void *) ((u8*)iov_base + DVDCSS_BLOCK_SIZE); | |
508 iov_len -= DVDCSS_BLOCK_SIZE; | |
509 } | |
510 | |
511 return i_ret; | |
512 } | |
513 | |
514 /** | |
515 * \brief Close the DVD and clean up the library. | |
516 * | |
517 * \param dvdcss a \e libdvdcss instance. | |
518 * \return zero in case of success, a negative value otherwise. | |
519 * | |
520 * This function closes the DVD device and frees all the memory allocated | |
521 * by \e libdvdcss. On return, the #dvdcss_t is invalidated and may not be | |
522 * used again. | |
523 */ | |
524 extern int dvdcss_close ( dvdcss_t dvdcss ) | |
525 { | |
526 dvd_title_t *p_title; | |
527 int i_ret; | |
528 | |
529 /* Free our list of keys */ | |
530 p_title = dvdcss->p_titles; | |
531 while( p_title ) | |
532 { | |
533 dvd_title_t *p_tmptitle = p_title->p_next; | |
534 free( p_title ); | |
535 p_title = p_tmptitle; | |
536 } | |
537 | |
538 i_ret = _dvdcss_close( dvdcss ); | |
539 | |
540 if( i_ret < 0 ) | |
541 { | |
542 return i_ret; | |
543 } | |
544 | |
545 free( dvdcss->psz_device ); | |
546 free( dvdcss ); | |
547 | |
548 return 0; | |
549 } | |
550 | |
551 /* | |
552 * Deprecated. See dvdcss_seek(). | |
553 */ | |
554 #undef dvdcss_title | |
555 extern int dvdcss_title ( dvdcss_t dvdcss, int i_block ) | |
556 { | |
557 return _dvdcss_title( dvdcss, i_block ); | |
558 } | |
559 |