summaryrefslogtreecommitdiffstats
path: root/contrib/libdvdread/P03-mingw-disable-dlopen.patch
blob: 515526289fda87d14946b95156d4d76e68bee8a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
diff -Naur libdvdread.orig/configure libdvdread/configure
--- libdvdread.orig/configure	2006-10-06 04:14:24.000000000 -0400
+++ libdvdread/configure	2009-03-10 17:48:56.000000000 -0400
@@ -18889,11 +18889,6 @@
 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
 if test $ac_cv_lib_dl_dlopen = yes; then
    DL_LIBS=-ldl
-else
-  { { echo "$as_me:$LINENO: error: You need libdl (dlopen)" >&5
-echo "$as_me: error: You need libdl (dlopen)" >&2;}
-   { (exit 1); exit 1; }; }
-
 fi
 
 
diff -Naur libdvdread.orig/dvdread/dvd_input.c libdvdread/dvdread/dvd_input.c
--- libdvdread.orig/dvdread/dvd_input.c	2005-09-19 09:43:08.000000000 -0400
+++ libdvdread/dvdread/dvd_input.c	2009-03-10 18:01:43.000000000 -0400
@@ -44,18 +44,6 @@
 
 char *      (*dvdinput_error) (dvd_input_t);
 
-#ifdef HAVE_DVDCSS_DVDCSS_H
-/* linking to libdvdcss */
-#include <dvdcss/dvdcss.h>
-#define DVDcss_open(a) dvdcss_open((char*)(a))
-#define DVDcss_close   dvdcss_close
-#define DVDcss_seek    dvdcss_seek
-#define DVDcss_title   dvdcss_title
-#define DVDcss_read    dvdcss_read
-#define DVDcss_error   dvdcss_error
-#else
-/* dlopening libdvdcss */
-#include <dlfcn.h>
 typedef struct dvdcss_s *dvdcss_handle;
 static dvdcss_handle (*DVDcss_open)  (const char *);
 static int           (*DVDcss_close) (dvdcss_handle);
@@ -63,7 +51,6 @@
 static int           (*DVDcss_title) (dvdcss_handle, int); 
 static int           (*DVDcss_read)  (dvdcss_handle, void *, int, int);
 static char *        (*DVDcss_error) (dvdcss_handle);
-#endif
 
 /* The DVDinput handle, add stuff here for new input methods. */
 struct dvd_input_s {
@@ -290,17 +277,7 @@
  */
 void dvdinput_free(void)
 {
-#ifdef HAVE_DVDCSS_DVDCSS_H
-  /* linked statically, nothing to free */
   return;
-#else
-  if(dvdcss_library) {
-    dlclose(dvdcss_library);
-    dvdcss_library = NULL;
-  }
-  dvdcss_library_init = 0;
-  return;
-#endif
 }
 
 
@@ -324,58 +301,6 @@
 
   verbose = get_verbose();
   
-#ifdef HAVE_DVDCSS_DVDCSS_H
-  /* linking to libdvdcss */
-  dvdcss_library = &dvdcss_library;  /* Give it some value != NULL */
-  /* the DVDcss_* functions have been #defined at the top */
-  dvdcss_version = &dvdcss_interface_2;
-
-#else
-
-  dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
-
-  if(dvdcss_library != NULL) {
-#if defined(__OpenBSD__) && !defined(__ELF__)
-#define U_S "_"
-#else
-#define U_S
-#endif
-    DVDcss_open = (dvdcss_handle (*)(const char*))
-      dlsym(dvdcss_library, U_S "dvdcss_open");
-    DVDcss_close = (int (*)(dvdcss_handle))
-      dlsym(dvdcss_library, U_S "dvdcss_close");
-    DVDcss_title = (int (*)(dvdcss_handle, int))
-      dlsym(dvdcss_library, U_S "dvdcss_title");
-    DVDcss_seek = (int (*)(dvdcss_handle, int, int))
-      dlsym(dvdcss_library, U_S "dvdcss_seek");
-    DVDcss_read = (int (*)(dvdcss_handle, void*, int, int))
-      dlsym(dvdcss_library, U_S "dvdcss_read");
-    DVDcss_error = (char* (*)(dvdcss_handle))
-      dlsym(dvdcss_library, U_S "dvdcss_error");
-    
-    dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
-
-    if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
-      if(verbose >= 0) {
-        fprintf(stderr, 
-                "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
-                "libdvdread: You should get the latest version from "
-                "http://www.videolan.org/\n" );
-      }
-      dlclose(dvdcss_library);
-      dvdcss_library = NULL;
-    } else if(!DVDcss_open  || !DVDcss_close || !DVDcss_title || !DVDcss_seek
-              || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
-      if(verbose >= 0) {
-        fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
-                "this shouldn't happen !\n");
-      }
-      dlclose(dvdcss_library);
-      dvdcss_library = NULL;
-    }
-  }
-#endif /* HAVE_DVDCSS_DVDCSS_H */
-
   dvdcss_library_init = 1;
   
   if(dvdcss_library) {
diff -Naur libdvdread.orig/dvdread/dvd_reader.c libdvdread/dvdread/dvd_reader.c
--- libdvdread.orig/dvdread/dvd_reader.c	2006-10-06 03:58:03.000000000 -0400
+++ libdvdread/dvdread/dvd_reader.c	2009-03-10 17:51:22.000000000 -0400
@@ -183,7 +183,7 @@
   dev->align = align;
 }
 
-#ifdef WIN32 /* replacement gettimeofday implementation */
+#if defined(WIN32) && !defined(__MINGW32__) /* replacement gettimeofday implementation */
 #include <sys/timeb.h>
 static int gettimeofday( struct timeval *tv, void *tz )
 {