1 diff -Naur libdvdread.orig/configure libdvdread/configure
2 --- libdvdread.orig/configure 2006-10-06 04:14:24.000000000 -0400
3 +++ libdvdread/configure 2009-03-10 17:48:56.000000000 -0400
4 @@ -18889,11 +18889,6 @@
5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
6 if test $ac_cv_lib_dl_dlopen = yes; then
9 - { { echo "$as_me:$LINENO: error: You need libdl (dlopen)" >&5
10 -echo "$as_me: error: You need libdl (dlopen)" >&2;}
11 - { (exit 1); exit 1; }; }
16 diff -Naur libdvdread.orig/dvdread/dvd_input.c libdvdread/dvdread/dvd_input.c
17 --- libdvdread.orig/dvdread/dvd_input.c 2005-09-19 09:43:08.000000000 -0400
18 +++ libdvdread/dvdread/dvd_input.c 2009-03-10 18:01:43.000000000 -0400
21 char * (*dvdinput_error) (dvd_input_t);
23 -#ifdef HAVE_DVDCSS_DVDCSS_H
24 -/* linking to libdvdcss */
25 -#include <dvdcss/dvdcss.h>
26 -#define DVDcss_open(a) dvdcss_open((char*)(a))
27 -#define DVDcss_close dvdcss_close
28 -#define DVDcss_seek dvdcss_seek
29 -#define DVDcss_title dvdcss_title
30 -#define DVDcss_read dvdcss_read
31 -#define DVDcss_error dvdcss_error
33 -/* dlopening libdvdcss */
35 typedef struct dvdcss_s *dvdcss_handle;
36 static dvdcss_handle (*DVDcss_open) (const char *);
37 static int (*DVDcss_close) (dvdcss_handle);
39 static int (*DVDcss_title) (dvdcss_handle, int);
40 static int (*DVDcss_read) (dvdcss_handle, void *, int, int);
41 static char * (*DVDcss_error) (dvdcss_handle);
44 /* The DVDinput handle, add stuff here for new input methods. */
48 void dvdinput_free(void)
50 -#ifdef HAVE_DVDCSS_DVDCSS_H
51 - /* linked statically, nothing to free */
54 - if(dvdcss_library) {
55 - dlclose(dvdcss_library);
56 - dvdcss_library = NULL;
58 - dvdcss_library_init = 0;
66 verbose = get_verbose();
68 -#ifdef HAVE_DVDCSS_DVDCSS_H
69 - /* linking to libdvdcss */
70 - dvdcss_library = &dvdcss_library; /* Give it some value != NULL */
71 - /* the DVDcss_* functions have been #defined at the top */
72 - dvdcss_version = &dvdcss_interface_2;
76 - dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
78 - if(dvdcss_library != NULL) {
79 -#if defined(__OpenBSD__) && !defined(__ELF__)
84 - DVDcss_open = (dvdcss_handle (*)(const char*))
85 - dlsym(dvdcss_library, U_S "dvdcss_open");
86 - DVDcss_close = (int (*)(dvdcss_handle))
87 - dlsym(dvdcss_library, U_S "dvdcss_close");
88 - DVDcss_title = (int (*)(dvdcss_handle, int))
89 - dlsym(dvdcss_library, U_S "dvdcss_title");
90 - DVDcss_seek = (int (*)(dvdcss_handle, int, int))
91 - dlsym(dvdcss_library, U_S "dvdcss_seek");
92 - DVDcss_read = (int (*)(dvdcss_handle, void*, int, int))
93 - dlsym(dvdcss_library, U_S "dvdcss_read");
94 - DVDcss_error = (char* (*)(dvdcss_handle))
95 - dlsym(dvdcss_library, U_S "dvdcss_error");
97 - dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
99 - if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
102 - "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
103 - "libdvdread: You should get the latest version from "
104 - "http://www.videolan.org/\n" );
106 - dlclose(dvdcss_library);
107 - dvdcss_library = NULL;
108 - } else if(!DVDcss_open || !DVDcss_close || !DVDcss_title || !DVDcss_seek
109 - || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
111 - fprintf(stderr, "libdvdread: Missing symbols in libdvdcss.so.2, "
112 - "this shouldn't happen !\n");
114 - dlclose(dvdcss_library);
115 - dvdcss_library = NULL;
118 -#endif /* HAVE_DVDCSS_DVDCSS_H */
120 dvdcss_library_init = 1;
123 diff -Naur libdvdread.orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
124 --- libdvdread.orig/dvdread/dvd_reader.c 2006-10-06 03:58:03.000000000 -0400
125 +++ libdvdread/dvdread/dvd_reader.c 2009-03-10 17:51:22.000000000 -0400
130 -#ifdef WIN32 /* replacement gettimeofday implementation */
131 +#if defined(WIN32) && !defined(__MINGW32__) /* replacement gettimeofday implementation */
132 #include <sys/timeb.h>
133 static int gettimeofday( struct timeval *tv, void *tz )