summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-18 20:44:01 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-18 20:44:01 +0000
commita743c0a73824f1f3bce5b59ef6d57e871d3f5022 (patch)
tree84fc641cdea0bcbe7dc54d05c32dfd5ae617cfae /loader
parent70017fa3889084ce2c5317cf352f7581ff244d76 (diff)
downloadmpv-a743c0a73824f1f3bce5b59ef6d57e871d3f5022.tar.bz2
mpv-a743c0a73824f1f3bce5b59ef6d57e871d3f5022.tar.xz
Split codec path related code into a separate file to fix Windows build.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30930 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/codecpath.c26
-rw-r--r--loader/codecpath.h12
-rw-r--r--loader/drv.c22
-rw-r--r--loader/drv.h1
-rw-r--r--loader/elfdll.c2
-rw-r--r--loader/module.c2
-rw-r--r--loader/win32.c3
7 files changed, 42 insertions, 26 deletions
diff --git a/loader/codecpath.c b/loader/codecpath.c
new file mode 100644
index 0000000000..0996f592f1
--- /dev/null
+++ b/loader/codecpath.c
@@ -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;
+}
diff --git a/loader/codecpath.h b/loader/codecpath.h
new file mode 100644
index 0000000000..0532e9a3a1
--- /dev/null
+++ b/loader/codecpath.h
@@ -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 */
diff --git a/loader/drv.c b/loader/drv.c
index 13945538d2..bfc57a4d1c 100644
--- a/loader/drv.c
+++ b/loader/drv.c
@@ -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 @@ extern char* def_path;
"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,
diff --git a/loader/drv.h b/loader/drv.h
index 9ae1f8fbec..6f20b8ce54 100644
--- a/loader/drv.h
+++ b/loader/drv.h
@@ -9,7 +9,6 @@
#include "wine/windef.h"
#include "wine/driver.h"
-void SetCodecPath(const char* path);
void CodecAlloc(void);
void CodecRelease(void);
diff --git a/loader/elfdll.c b/loader/elfdll.c
index e4a0190f89..fe88227240 100644
--- a/loader/elfdll.c
+++ b/loader/elfdll.c
@@ -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 @@ void dump_exports(HMODULE hModule);
/*---------------- END HACKS ---------------*/
//char *extra_ld_library_path = "/usr/lib/win32";
-extern char* def_path;
struct elfdll_image
{
diff --git a/loader/module.c b/loader/module.c
index 79c01270d3..98b31125af 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -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 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
{
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;
diff --git a/loader/win32.c b/loader/win32.c
index b687135049..9ca0a4a3ab 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -49,6 +49,7 @@ for DLL to know too much about its environment.
#include "loader.h"
#include "com.h"
#include "ext.h"
+#include "codecpath.h"
#include <stdlib.h>
#include <assert.h>
@@ -77,8 +78,6 @@ for DLL to know too much about its environment.
#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