summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-17 19:18:29 +0000
committerfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-08-17 19:18:29 +0000
commitb2e24300c98d0cf7a93901446086d683fdc6e328 (patch)
treee1e040e381c86202b761e70d201aa682e5b62b51 /mplayer.c
parentec688473b3b9152594332cf689c9605225c7dd3f (diff)
downloadmpv-b2e24300c98d0cf7a93901446086d683fdc6e328.tar.bz2
mpv-b2e24300c98d0cf7a93901446086d683fdc6e328.tar.xz
dll loading from codecs dir support for windows
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10647 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/mplayer.c b/mplayer.c
index fa304b4e2d..1092d9ce90 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -782,6 +782,40 @@ int gui_no_filename=0;
#endif
#endif
+#if defined(WIN32) && defined(USE_WIN32DLL)
+{ /*make our codec dirs available for LoadLibraryA()*/
+ char tmppath[MAX_PATH*2 + 1];
+ char win32path[MAX_PATH];
+ char realpath[MAX_PATH];
+ int WINAPI SetEnvironmentVariableA(char*,char*);
+ int WINAPI GetModuleFileNameA(void*,char*,int);
+#ifdef __CYGWIN__
+ cygwin_conv_to_full_win32_path(WIN32_PATH,win32path);
+ strcpy(tmppath,win32path);
+#ifdef USE_REALCODECS
+ cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath);
+ sprintf(tmppath,"%s;%s",win32path,realpath);
+#endif /*USE_REALCODECS*/
+#else
+ if(!strstr(WIN32_PATH,":")){
+ GetModuleFileNameA(NULL, win32path, MAX_PATH);
+ strcpy(win32path + strlen(win32path) - strlen("mplayer.exe"), WIN32_PATH);
+ }
+ else strcpy(win32path,WIN32_PATH);
+ strcpy(tmppath,win32path);
+#ifdef USE_REALCODECS
+ if(!strstr(REALCODEC_PATH,":")){
+ GetModuleFileNameA(NULL, realpath, MAX_PATH);
+ strcpy(realpath + strlen(realpath) - strlen("mplayer.exe"), REALCODEC_PATH);
+ }
+ else strcpy(realpath,REALCODEC_PATH);
+ sprintf(tmppath,"%s;%s",win32path,realpath);
+#endif /*USE_REALCODECS*/
+#endif /*__CYGWIN__*/
+ SetEnvironmentVariableA("PATH", tmppath);
+}
+#endif /*WIN32 && USE_WIN32DLL*/
+
#ifdef USE_TV
tv_param_immediate = 1;
#endif