summaryrefslogtreecommitdiffstats
path: root/src/xine-lib-2-build_fixes.patch
blob: 8fcb100366e90ba55687e6262444d6981acef52f (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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
diff -urN xine-lib-1.2.4/configure.ac xine-lib-1.2.4-patch/configure.ac
--- xine-lib-1.2.4/configure.ac	2013-12-17 11:45:43.657189416 +0200
+++ xine-lib-1.2.4-patch/configure.ac	2013-12-17 14:57:28.907822042 +0200
@@ -544,7 +544,7 @@
 
         if test "$WIN32_SYS" = "mingw32"; then
             WIN32_INCLUDES='-I$(top_srcdir)/win32/include'
-            LIBS="-lwinmm -lwsock32 $LIBS"
+            LIBS="-lwinmm -lwsock32 -lmman $LIBS"
             LDFLAGS="-Wl,--enable-stdcall-fixup $LDFLAGS"
             dnl iberty has been needed only in older versions
             AC_CHECK_LIB(iberty, strncomp, [GOOM_LIBS="-liberty"])
diff -urN xine-lib-1.2.4/include/xine/xine_internal.h xine-lib-1.2.4-patch/include/xine/xine_internal.h
--- xine-lib-1.2.4/include/xine/xine_internal.h	2013-09-18 13:04:54.000000000 +0300
+++ xine-lib-1.2.4-patch/include/xine/xine_internal.h	2013-12-17 15:14:55.229127435 +0200
@@ -55,6 +55,26 @@
 /* used by plugin loader */
 #define XINE_VERSION_CODE                XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION
 
+// Add there to support them on MinGW
+#define timeradd(a, b, result) \
+    do { \
+        (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
+        (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+        if ((result)->tv_usec >= 1000000L) { \
+            ++(result)->tv_sec; \
+            (result)->tv_usec -= 1000000L; \
+        } \
+    } while (0)
+
+#define timersub(a, b, result) \
+    do { \
+        (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+        (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+        if ((result)->tv_usec < 0) { \
+            --(result)->tv_sec; \
+            (result)->tv_usec += 1000000L; \
+        } \
+    } while (0)
 
 /*
  * log constants
diff -urN xine-lib-1.2.4/include/xine/xineutils.h xine-lib-1.2.4-patch/include/xine/xineutils.h
--- xine-lib-1.2.4/include/xine/xineutils.h	2013-09-18 13:04:54.000000000 +0300
+++ xine-lib-1.2.4-patch/include/xine/xineutils.h	2013-12-20 12:29:33.465030673 +0200
@@ -119,8 +119,8 @@
 
 
 		     /* Optimized/fast memcpy */
-
-extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED;
+//extern void *xine_fast_memcpy(void *to, const void *from, size_t len);
+#define xine_fast_memcpy(a, b, c) memcpy(a, b, c)
 
 /*
  * Debug stuff
diff -urN xine-lib-1.2.4/misc/Makefile.am xine-lib-1.2.4-patch/misc/Makefile.am
--- xine-lib-1.2.4/misc/Makefile.am	2012-02-05 21:17:01.000000000 +0200
+++ xine-lib-1.2.4-patch/misc/Makefile.am	2013-12-19 09:20:56.937982071 +0200
@@ -21,7 +21,7 @@
 pkgconfig_DATA=libxine.pc
 
 xine_list_@XINE_SERIES@_SOURCES = xine-list.c
-xine_list_@XINE_SERIES@_LDADD = $(XINE_LIB)
+xine_list_@XINE_SERIES@_LDADD = $(XINE_LIB) $(top_builddir)/src/xine-utils/libxineutils.la
 
 fontdir = $(pkgdatadir)/fonts
 dist_font_DATA = \
diff -urN xine-lib-1.2.4/src/audio_dec/xine_lpcm_decoder.c xine-lib-1.2.4-patch/src/audio_dec/xine_lpcm_decoder.c
--- xine-lib-1.2.4/src/audio_dec/xine_lpcm_decoder.c	2013-09-18 13:04:54.000000000 +0300
+++ xine-lib-1.2.4-patch/src/audio_dec/xine_lpcm_decoder.c	2013-12-17 15:18:20.459131654 +0200
@@ -41,7 +41,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#ifdef __MINGW32__
+#include <winsock.h>
+#else
 #include <arpa/inet.h> /* htons */
+#endif
 #include <netinet/in.h> /* ntohs */
 
 #include <xine/xine_internal.h>
diff -urN xine-lib-1.2.4/src/demuxers/demux_ts.c xine-lib-1.2.4-patch/src/demuxers/demux_ts.c
--- xine-lib-1.2.4/src/demuxers/demux_ts.c	2013-09-23 23:56:56.000000000 +0300
+++ xine-lib-1.2.4-patch/src/demuxers/demux_ts.c	2013-12-18 12:04:09.269573623 +0200
@@ -146,7 +146,11 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <string.h>
-#include <arpa/inet.h>
+#ifdef __MINGW32__
+#include <winsock.h>
+#else
+#include <arpa/inet.h> /* htons */
+#endif
 
 #ifdef HAVE_FFMPEG_AVUTIL_H
 #  include <crc.h>
diff -urN xine-lib-1.2.4/src/input/libdvdnav/dvdnav_internal.h xine-lib-1.2.4-patch/src/input/libdvdnav/dvdnav_internal.h
--- xine-lib-1.2.4/src/input/libdvdnav/dvdnav_internal.h	2009-11-30 23:28:34.000000000 +0200
+++ xine-lib-1.2.4-patch/src/input/libdvdnav/dvdnav_internal.h	2013-12-18 11:56:09.153450165 +0200
@@ -64,11 +64,11 @@
 /* pthread_mutex_* wrapper for win32 */
 #include <windows.h>
 #include <process.h>
-typedef CRITICAL_SECTION pthread_mutex_t;
-#define pthread_mutex_init(a, b) InitializeCriticalSection(a)
-#define pthread_mutex_lock(a)    EnterCriticalSection(a)
-#define pthread_mutex_unlock(a)  LeaveCriticalSection(a)
-#define pthread_mutex_destroy(a)
+// typedef CRITICAL_SECTION pthread_mutex_t;
+// #define pthread_mutex_init(a, b) InitializeCriticalSection(a)
+// #define pthread_mutex_lock(a)    EnterCriticalSection(a)
+// #define pthread_mutex_unlock(a)  LeaveCriticalSection(a)
+// #define pthread_mutex_destroy(a)
 
 #include <io.h> /* read() */
 #define lseek64 _lseeki64
diff -urN xine-lib-1.2.4/src/post/deinterlace/speedy.c xine-lib-1.2.4-patch/src/post/deinterlace/speedy.c
--- xine-lib-1.2.4/src/post/deinterlace/speedy.c	2012-05-26 23:49:59.000000000 +0300
+++ xine-lib-1.2.4-patch/src/post/deinterlace/speedy.c	2013-12-20 12:24:59.608986588 +0200
@@ -1392,28 +1392,28 @@
 }
 #endif
 
-
-#define speedy_memcpy_c xine_fast_memcpy
-#define speedy_memcpy_mmx xine_fast_memcpy
-#define speedy_memcpy_mmxext xine_fast_memcpy
+//#undef xine_fast_memcpy
+//#define speedy_memcpy_c xine_fast_memcpy
+//#define speedy_memcpy_mmx xine_fast_memcpy
+//#define speedy_memcpy_mmxext xine_fast_memcpy
 
 
 static void blit_packed422_scanline_c( uint8_t *dest, const uint8_t *src, int width )
 {
-    speedy_memcpy_c( dest, src, width*2 );
+    memcpy( dest, src, width*2 );
 }
 
 #if defined(ARCH_X86) || defined(ARCH_X86_64)
 static void blit_packed422_scanline_mmx( uint8_t *dest, const uint8_t *src, int width )
 {
-    speedy_memcpy_mmx( dest, src, width*2 );
+    memcpy( dest, src, width*2 );
 }
 #endif
 
 #if defined(ARCH_X86) || defined(ARCH_X86_64)
 static void blit_packed422_scanline_mmxext( uint8_t *dest, const uint8_t *src, int width )
 {
-    speedy_memcpy_mmxext( dest, src, width*2 );
+    memcpy( dest, src, width*2 );
 }
 #endif
 
@@ -2602,7 +2602,8 @@
     kill_chroma_packed422_inplace_scanline = kill_chroma_packed422_inplace_scanline_c;
     mirror_packed422_inplace_scanline = mirror_packed422_inplace_scanline_c;
     halfmirror_packed422_inplace_scanline = halfmirror_packed422_inplace_scanline_c;
-    speedy_memcpy = speedy_memcpy_c;
+    speedy_memcpy = memcpy;
+    //speedy_memcpy = speedy_memcpy_c;
     diff_packed422_block8x8 = diff_packed422_block8x8_c;
     a8_subpix_blit_scanline = a8_subpix_blit_scanline_c;
     quarter_blit_vertical_packed422_scanline = quarter_blit_vertical_packed422_scanline_c;
@@ -2644,7 +2645,8 @@
         invert_colour_packed422_inplace_scanline = invert_colour_packed422_inplace_scanline_mmx;
         vfilter_chroma_121_packed422_scanline = vfilter_chroma_121_packed422_scanline_mmx;
         vfilter_chroma_332_packed422_scanline = vfilter_chroma_332_packed422_scanline_mmx;
-        speedy_memcpy = speedy_memcpy_mmxext;
+        //speedy_memcpy = speedy_memcpy_mmxext;
+        speedy_memcpy = memcpy;
     } else if( speedy_accel & MM_ACCEL_X86_MMX ) {
         if( verbose ) {
             printf( "speedycode: Using MMX optimized functions.\n" );
@@ -2660,7 +2662,8 @@
         invert_colour_packed422_inplace_scanline = invert_colour_packed422_inplace_scanline_mmx;
         vfilter_chroma_121_packed422_scanline = vfilter_chroma_121_packed422_scanline_mmx;
         vfilter_chroma_332_packed422_scanline = vfilter_chroma_332_packed422_scanline_mmx;
-        speedy_memcpy = speedy_memcpy_mmx;
+        //speedy_memcpy = speedy_memcpy_mmx;
+        speedy_memcpy = memcpy;
     } else {
         if( verbose ) {
             printf( "speedycode: No MMX or MMXEXT support detected, using C fallbacks.\n" );
diff -urN xine-lib-1.2.4/src/vdr/input_vdr.c xine-lib-1.2.4-patch/src/vdr/input_vdr.c
--- xine-lib-1.2.4/src/vdr/input_vdr.c	2013-09-18 13:04:54.000000000 +0300
+++ xine-lib-1.2.4-patch/src/vdr/input_vdr.c	2013-12-20 12:23:36.313756861 +0200
@@ -28,13 +28,13 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
-#include <sys/poll.h>
+// #include <sys/poll.h>
 #include <errno.h>
 #include <pthread.h>
 
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <resolv.h>
+// #include <resolv.h>
 #include <netdb.h>
 
 #define LOG_MODULE "input_vdr"
@@ -1919,7 +1919,7 @@
   filename = strdup(filename);
 
   _x_mrl_unescape (filename);
-  this->fh = xine_open_cloexec(filename, O_RDONLY | O_NONBLOCK);
+  this->fh = xine_open_cloexec(filename, O_RDONLY);
 
   lprintf("filename '%s'\n", filename);
 
@@ -1934,7 +1934,7 @@
   }
 
   {
-    struct pollfd poll_fh = { this->fh, POLLIN, 0 };
+    /*struct pollfd poll_fh = { this->fh, POLLIN, 0 };
 
     int r = poll(&poll_fh, 1, 300);
     if (1 != r)
@@ -1945,10 +1945,10 @@
               _("timeout expired during setup phase"));
       free (filename);
       return 0;
-    }
+    }*/
   }
 
-  fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
+  //fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
 
   /* eat initial handshake byte */
   {
@@ -2098,7 +2098,7 @@
   if ((this->fh = vdr_plugin_open_socket(this, host, port + 0)) == -1)
     return 0;
 
-  fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
+  //fcntl(this->fh, F_SETFL, ~O_NONBLOCK & fcntl(this->fh, F_GETFL, 0));
 
   if ((this->fh_control = vdr_plugin_open_socket(this, host, port + 1)) == -1)
     return 0;
diff -urN xine-lib-1.2.4/src/video_dec/libjpeg.c xine-lib-1.2.4-patch/src/video_dec/libjpeg.c
--- xine-lib-1.2.4/src/video_dec/libjpeg.c	2012-11-23 22:08:21.000000000 +0200
+++ xine-lib-1.2.4-patch/src/video_dec/libjpeg.c	2013-12-18 10:01:45.755428630 +0200
@@ -26,6 +26,7 @@
 #endif
 
 
+
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
@@ -33,6 +34,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdio.h>
+#include <basetsd.h>
 
 #define LOG_MODULE "jpeg_video_decoder"
 #define LOG_VERBOSE
diff -urN xine-lib-1.2.4/src/xine-utils/memcpy.c xine-lib-1.2.4-patch/src/xine-utils/memcpy.c
--- xine-lib-1.2.4/src/xine-utils/memcpy.c	2013-09-18 19:58:32.000000000 +0300
+++ xine-lib-1.2.4-patch/src/xine-utils/memcpy.c	2013-12-20 12:30:01.733448201 +0200
@@ -55,7 +55,7 @@
 #include <xine/xine_internal.h>
 #include "../xine-engine/xine_private.h"
 
-void *(* xine_fast_memcpy)(void *to, const void *from, size_t len);
+
 
 /* Original comments from mplayer (file: aclib.c)
  This part of code was taken by me from Linux-2.4.3 and slightly modified
@@ -558,7 +558,7 @@
       && (config_flags & memcpy_method[method].cpu_require) ==
       memcpy_method[method].cpu_require ) {
     lprintf("using %s memcpy()\n", memcpy_method[method].name );
-    xine_fast_memcpy = memcpy_method[method].function;
+    // xine_fast_memcpy = memcpy_method[method].function;
     return;
   } else {
     xprintf(xine, XINE_VERBOSITY_DEBUG, "xine: will probe memcpy on startup\n" );
@@ -603,13 +603,13 @@
      (config_flags & memcpy_method[best].cpu_require) ==
       memcpy_method[best].cpu_require ) {
     lprintf("using %s memcpy()\n", memcpy_method[best].name );
-    xine_fast_memcpy = memcpy_method[best].function;
+    // xine_fast_memcpy = memcpy_method[best].function;
     return;
   }
 
   best = 0;
 
-  xine_fast_memcpy = memcpy;
+  // xine_fast_memcpy = memcpy;
 
   if( (buf1 = malloc(BUFSIZE)) == NULL )
     return;