[Mplayer-cvslog] CVS: main/libmpcodecs ad_realaud.c,1.22,1.23 vd_realvid.c,1.21,1.22
Alex Beregszaszi
alex at mplayerhq.hu
Sun May 11 19:58:29 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv12813
Modified Files:
ad_realaud.c vd_realvid.c
Log Message:
cygwin/mingw32 support by Sascha Sommer
Index: ad_realaud.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_realaud.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- ad_realaud.c 30 Apr 2003 19:45:34 -0000 1.22
+++ ad_realaud.c 11 May 2003 17:58:02 -0000 1.23
@@ -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 @@
} wra_init_t;
#endif
+#ifdef HAVE_LIBDL
static int load_syms_linux(char *path)
{
void *handle;
@@ -147,11 +150,14 @@
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 @@
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 @@
/* 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
Index: vd_realvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_realvid.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- vd_realvid.c 9 Mar 2003 17:19:41 -0000 1.21
+++ vd_realvid.c 11 May 2003 17:58:03 -0000 1.22
@@ -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 @@
}
/* exits program when failure */
+#ifdef HAVE_LIBDL
static int load_syms_linux(char *path) {
void *handle;
@@ -126,10 +129,13 @@
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 @@
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 @@
/* 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 @@
if (rv_handle) FreeLibrary(rv_handle);
} else
#endif
+#ifdef HAVE_LIBDL
if(rv_handle) dlclose(rv_handle);
+#endif
rv_handle=NULL;
}
More information about the MPlayer-cvslog
mailing list