summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-11 17:58:03 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-05-11 17:58:03 +0000
commitfd63a6fe684e3af0b975da26f7dda64ba3f3b628 (patch)
tree28eb8dd2da37dd5fbce4a99d78a7e5ca10657645 /libmpcodecs
parent7787041e0b7781aa1620695d0cf539131c4dcf83 (diff)
downloadmpv-fd63a6fe684e3af0b975da26f7dda64ba3f3b628.tar.bz2
mpv-fd63a6fe684e3af0b975da26f7dda64ba3f3b628.tar.xz
cygwin/mingw32 support by Sascha Sommer
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10094 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_realaud.c14
-rw-r--r--libmpcodecs/vd_realvid.c14
2 files changed, 25 insertions, 3 deletions
diff --git a/libmpcodecs/ad_realaud.c b/libmpcodecs/ad_realaud.c
index 01c387fe8a..998afcbfb9 100644
--- a/libmpcodecs/ad_realaud.c
+++ b/libmpcodecs/ad_realaud.c
@@ -8,7 +8,9 @@
#ifdef USE_REALCODECS
//#include <stddef.h>
+#ifdef HAVE_LIBDL
#include <dlfcn.h>
+#endif
#include "help_mp.h"
#include "ad_internal.h"
@@ -112,6 +114,7 @@ typedef struct __attribute__((__packed__)) {
} wra_init_t;
#endif
+#ifdef HAVE_LIBDL
static int load_syms_linux(char *path)
{
void *handle;
@@ -147,11 +150,14 @@ static int load_syms_linux(char *path)
mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Cannot resolve symbols - incompatible dll: %s\n",path);
dlclose(handle);
return 0;
-}
+}
+#endif
#ifdef USE_WIN32DLL
+#ifdef WIN32_LOADER
#include "../loader/ldt_keeper.h"
+#endif
void* WINAPI LoadLibraryA(char* name);
void* WINAPI GetProcAddress(void* handle,char *func);
int WINAPI FreeLibrary(void *handle);
@@ -161,7 +167,9 @@ static int load_sysm_windows(char *path)
void *handle;
mp_msg(MSGT_DECVIDEO, MSGL_INFO, "opening win32 dll '%s'\n", path);
+#ifdef WIN32_LOADER
Setup_LDT_Keeper();
+#endif
handle = LoadLibraryA(path);
if (!handle)
{
@@ -209,7 +217,9 @@ static int preinit(sh_audio_t *sh){
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */
- if (!load_syms_linux(path))
+#ifdef HAVE_LIBDL
+ if (strstr(sh->codec->dll,".dll") || !load_syms_linux(path))
+#endif
#ifdef USE_WIN32DLL
if (!load_sysm_windows(path))
#endif
diff --git a/libmpcodecs/vd_realvid.c b/libmpcodecs/vd_realvid.c
index 1121566735..d5c824bc60 100644
--- a/libmpcodecs/vd_realvid.c
+++ b/libmpcodecs/vd_realvid.c
@@ -4,7 +4,9 @@
#include "config.h"
#ifdef USE_REALCODECS
+#ifdef HAVE_LIBDL
#include <dlfcn.h>
+#endif
#include "mp_msg.h"
#include "help_mp.h"
@@ -96,6 +98,7 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
}
/* exits program when failure */
+#ifdef HAVE_LIBDL
static int load_syms_linux(char *path) {
void *handle;
@@ -126,10 +129,13 @@ static int load_syms_linux(char *path) {
dlclose(handle);
return 0;
}
+#endif
#ifdef USE_WIN32DLL
+#ifdef WIN32_LOADER
#include "../loader/ldt_keeper.h"
+#endif
void* WINAPI LoadLibraryA(char* name);
void* WINAPI GetProcAddress(void* handle,char* func);
int WINAPI FreeLibrary(void *handle);
@@ -138,7 +144,9 @@ static int load_syms_windows(char *path) {
void *handle;
mp_msg(MSGT_DECVIDEO,MSGL_INFO, "opening win32 dll '%s'\n", path);
+#ifdef WIN32_LOADER
Setup_LDT_Keeper();
+#endif
handle = LoadLibraryA(path);
mp_msg(MSGT_DECVIDEO,MSGL_V,"win32 real codec handle=%p \n",handle);
if (!handle) {
@@ -197,7 +205,9 @@ static int init(sh_video_t *sh){
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */
- if(!load_syms_linux(path))
+#ifdef HAVE_LIBDL
+ if(strstr(sh->codec->dll,".dll") || !load_syms_linux(path))
+#endif
#ifdef USE_WIN32DLL
if (!load_syms_windows(path))
#endif
@@ -253,7 +263,9 @@ static void uninit(sh_video_t *sh){
if (rv_handle) FreeLibrary(rv_handle);
} else
#endif
+#ifdef HAVE_LIBDL
if(rv_handle) dlclose(rv_handle);
+#endif
rv_handle=NULL;
}