changeset 30888:ff7b06c867cd

Split codec path related code into a separate file to fix Windows build.
author reimar
date Thu, 18 Mar 2010 20:44:01 +0000
parents f1e0aa08e3ee
children c0fe89cf9803
files Makefile loader/codecpath.c loader/codecpath.h loader/drv.c loader/drv.h loader/elfdll.c loader/module.c loader/win32.c mencoder.c mplayer.c
diffstat 10 files changed, 45 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Mar 18 00:45:18 2010 +0000
+++ b/Makefile	Thu Mar 18 20:44:01 2010 +0000
@@ -315,6 +315,7 @@
                                         libmpcodecs/vd_vfwex.c \
                                         libmpdemux/demux_avs.c \
                                         loader/afl.c \
+                                        loader/codecpath.c \
                                         loader/drv.c \
                                         loader/vfl.c \
                                         loader/dshow/DS_AudioDecoder.c \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loader/codecpath.c	Thu Mar 18 20:44:01 2010 +0000
@@ -0,0 +1,26 @@
+/*
+ * Modified for use with MPlayer, detailed changelog at
+ * http://svn.mplayerhq.hu/mplayer/trunk/
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "codecpath.h"
+
+char* def_path = BINARY_CODECS_PATH;
+
+static int needs_free=0;
+void SetCodecPath(const char* path)
+{
+    if(needs_free)free(def_path);
+    if(path==0)
+    {
+	def_path = BINARY_CODECS_PATH;
+	needs_free=0;
+	return;
+    }
+    def_path = malloc(strlen(path)+1);
+    strcpy(def_path, path);
+    needs_free=1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loader/codecpath.h	Thu Mar 18 20:44:01 2010 +0000
@@ -0,0 +1,12 @@
+/*
+ * Modified for use with MPlayer, detailed changelog at
+ * http://svn.mplayerhq.hu/mplayer/trunk/
+ */
+
+#ifndef MPLAYER_CODECPATH_H
+#define MPLAYER_CODECPATH_H
+
+extern char *def_path;
+void SetCodecPath(const char* path);
+
+#endif /* MPLAYER_CODECPATH_H */
--- a/loader/drv.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/loader/drv.c	Thu Mar 18 20:44:01 2010 +0000
@@ -25,12 +25,7 @@
 #ifndef __MINGW32__
 #include "ext.h"
 #endif
-
-#ifndef WIN32_LOADER
-char* def_path = BINARY_CODECS_PATH;
-#else
-extern char* def_path;
-#endif
+#include "codecpath.h"
 
 #if 1
 
@@ -65,21 +60,6 @@
     "pop %%ebx\n\t"::)
 #endif
 
-static int needs_free=0;
-void SetCodecPath(const char* path)
-{
-    if(needs_free)free(def_path);
-    if(path==0)
-    {
-	def_path = BINARY_CODECS_PATH;
-	needs_free=0;
-	return;
-    }
-    def_path = malloc(strlen(path)+1);
-    strcpy(def_path, path);
-    needs_free=1;
-}
-
 static DWORD dwDrvID = 0;
 
 LRESULT WINAPI SendDriverMessage(HDRVR hDriver, UINT message,
--- a/loader/drv.h	Thu Mar 18 00:45:18 2010 +0000
+++ b/loader/drv.h	Thu Mar 18 20:44:01 2010 +0000
@@ -9,7 +9,6 @@
 #include "wine/windef.h"
 #include "wine/driver.h"
 
-void SetCodecPath(const char* path);
 void CodecAlloc(void);
 void CodecRelease(void);
 
--- a/loader/elfdll.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/loader/elfdll.c	Thu Mar 18 20:44:01 2010 +0000
@@ -18,6 +18,7 @@
 #include "wine/debugtools.h"
 #include "wine/winerror.h"
 #include "debug.h"
+#include "codecpath.h"
 
 //DEFAULT_DEBUG_CHANNEL(elfdll)
 
@@ -38,7 +39,6 @@
 /*---------------- END HACKS ---------------*/
 
 //char *extra_ld_library_path = "/usr/lib/win32";
-extern char* def_path;
 
 struct elfdll_image
 {
--- a/loader/module.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/loader/module.c	Thu Mar 18 20:44:01 2010 +0000
@@ -46,6 +46,7 @@
 #endif
 #include "win32.h"
 #include "drv.h"
+#include "codecpath.h"
 
 #ifdef EMU_QTX_API
 #include "wrapper.h"
@@ -366,7 +367,6 @@
 {
 	WINE_MODREF *wm = 0;
 	char* listpath[] = { "", "", "/usr/lib/win32", "/usr/local/lib/win32", 0 };
-	extern char* def_path;
 	char path[512];
 	char checked[2000];
         int i = -1;
--- a/loader/win32.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/loader/win32.c	Thu Mar 18 20:44:01 2010 +0000
@@ -49,6 +49,7 @@
 #include "loader.h"
 #include "com.h"
 #include "ext.h"
+#include "codecpath.h"
 
 #include <stdlib.h>
 #include <assert.h>
@@ -77,8 +78,6 @@
 #include "osdep/mmap_anon.h"
 #include "libavutil/avstring.h"
 
-char* def_path = BINARY_CODECS_PATH;
-
 static void do_cpuid(unsigned int ax, unsigned int *regs)
 {
     __asm__ volatile
--- a/mencoder.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/mencoder.c	Thu Mar 18 20:44:01 2010 +0000
@@ -66,7 +66,7 @@
 #include "get_path.h"
 
 #ifdef CONFIG_WIN32DLL
-#include "loader/drv.h"         // for SetCodecPath()
+#include "loader/codecpath.h"         // for SetCodecPath()
 #endif
 
 #include "stream/stream.h"
--- a/mplayer.c	Thu Mar 18 00:45:18 2010 +0000
+++ b/mplayer.c	Thu Mar 18 20:44:01 2010 +0000
@@ -96,7 +96,7 @@
 #include "input/input.h"
 
 #ifdef CONFIG_WIN32DLL
-#include "loader/drv.h"         // for SetCodecPath()
+#include "loader/codecpath.h"         // for SetCodecPath()
 #endif
 
 int slave_mode=0;