Mercurial > libdvdread4.hg
comparison dvd_input.c @ 81:7e9feef7a82d src
Do not extract libdvdcss version via dvdcss_interface_2.
The variable is deprecated and only informs about the
libdvdcss API version, which carries no meaning nowadays.
author | diego |
---|---|
date | Thu, 21 Mar 2013 19:23:12 +0000 |
parents | d59aaee50e47 |
children | aa4a7b151801 |
comparison
equal
deleted
inserted
replaced
80:d59aaee50e47 | 81:7e9feef7a82d |
---|---|
268 * Setup read functions with either libdvdcss or minimal DVD access. | 268 * Setup read functions with either libdvdcss or minimal DVD access. |
269 */ | 269 */ |
270 int dvdinput_setup(void) | 270 int dvdinput_setup(void) |
271 { | 271 { |
272 void *dvdcss_library = NULL; | 272 void *dvdcss_library = NULL; |
273 char **dvdcss_version = NULL; | |
274 | 273 |
275 #ifdef HAVE_DVDCSS_DVDCSS_H | 274 #ifdef HAVE_DVDCSS_DVDCSS_H |
276 /* linking to libdvdcss */ | 275 /* linking to libdvdcss */ |
277 dvdcss_library = &dvdcss_library; /* Give it some value != NULL */ | 276 dvdcss_library = &dvdcss_library; /* Give it some value != NULL */ |
278 /* the DVDcss_* functions have been #defined at the top */ | |
279 dvdcss_version = &dvdcss_interface_2; | |
280 | 277 |
281 #else | 278 #else |
282 /* dlopening libdvdcss */ | 279 /* dlopening libdvdcss */ |
283 | 280 |
284 #ifdef __APPLE__ | 281 #ifdef __APPLE__ |
307 DVDcss_read = (int (*)(dvdcss_t, void*, int, int)) | 304 DVDcss_read = (int (*)(dvdcss_t, void*, int, int)) |
308 dlsym(dvdcss_library, U_S "dvdcss_read"); | 305 dlsym(dvdcss_library, U_S "dvdcss_read"); |
309 DVDcss_error = (char* (*)(dvdcss_t)) | 306 DVDcss_error = (char* (*)(dvdcss_t)) |
310 dlsym(dvdcss_library, U_S "dvdcss_error"); | 307 dlsym(dvdcss_library, U_S "dvdcss_error"); |
311 | 308 |
312 dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2"); | |
313 | |
314 if(dlsym(dvdcss_library, U_S "dvdcss_crack")) { | 309 if(dlsym(dvdcss_library, U_S "dvdcss_crack")) { |
315 fprintf(stderr, | 310 fprintf(stderr, |
316 "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n" | 311 "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n" |
317 "libdvdread: You should get the latest version from " | 312 "libdvdread: You should get the latest version from " |
318 "http://www.videolan.org/\n" ); | 313 "http://www.videolan.org/\n" ); |
319 dlclose(dvdcss_library); | 314 dlclose(dvdcss_library); |
320 dvdcss_library = NULL; | 315 dvdcss_library = NULL; |
321 } else if(!DVDcss_open || !DVDcss_close || !DVDcss_seek | 316 } else if(!DVDcss_open || !DVDcss_close || !DVDcss_seek |
322 || !DVDcss_read || !DVDcss_error || !dvdcss_version) { | 317 || !DVDcss_read || !DVDcss_error) { |
323 fprintf(stderr, "libdvdread: Missing symbols in %s, " | 318 fprintf(stderr, "libdvdread: Missing symbols in %s, " |
324 "this shouldn't happen !\n", CSS_LIB); | 319 "this shouldn't happen !\n", CSS_LIB); |
325 dlclose(dvdcss_library); | 320 dlclose(dvdcss_library); |
326 } | 321 } |
327 } | 322 } |
332 char *psz_method = getenv( "DVDCSS_METHOD" ); | 327 char *psz_method = getenv( "DVDCSS_METHOD" ); |
333 char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); | 328 char *psz_verbose = getenv( "DVDCSS_VERBOSE" ); |
334 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); | 329 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); |
335 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); | 330 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); |
336 */ | 331 */ |
337 fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n", | |
338 dvdcss_version ? *dvdcss_version : ""); | |
339 | 332 |
340 /* libdvdcss wrapper functions */ | 333 /* libdvdcss wrapper functions */ |
341 dvdinput_open = css_open; | 334 dvdinput_open = css_open; |
342 dvdinput_close = css_close; | 335 dvdinput_close = css_close; |
343 dvdinput_seek = css_seek; | 336 dvdinput_seek = css_seek; |