diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-20 23:27:07 +0000 |
---|---|---|
committer | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-03-20 23:27:07 +0000 |
commit | a06a3d476d268f9e17769916ebabf684af95e5e4 (patch) | |
tree | 770e41e412f3d8cb9f6b84483dfa79a5f57187d9 | |
parent | 64c4d367afac0e19c811fe48fb86a5786d5a2238 (diff) | |
download | mpv-a06a3d476d268f9e17769916ebabf684af95e5e4.tar.bz2 mpv-a06a3d476d268f9e17769916ebabf684af95e5e4.tar.xz |
Move SetCodecPath() from loader to get_path.c and make it unconditional.
This fixes compilation with the Win32 loader disabled but other binary
codec loaders enabled.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30942 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | cfg-common-opts.h | 2 | ||||
-rw-r--r-- | get_path.c | 18 | ||||
-rw-r--r-- | get_path.h | 3 | ||||
-rw-r--r-- | libmpcodecs/vd_xanim.c | 3 | ||||
-rw-r--r-- | loader/codecpath.c | 26 | ||||
-rw-r--r-- | loader/codecpath.h | 12 | ||||
-rw-r--r-- | loader/drv.c | 2 | ||||
-rw-r--r-- | loader/elfdll.c | 2 | ||||
-rw-r--r-- | loader/module.c | 2 | ||||
-rw-r--r-- | loader/win32.c | 2 | ||||
-rw-r--r-- | mencoder.c | 3 | ||||
-rw-r--r-- | mplayer.c | 3 |
13 files changed, 26 insertions, 53 deletions
@@ -315,7 +315,6 @@ SRCS_COMMON-$(WIN32DLL) += libmpcodecs/ad_acm.c \ 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 \ diff --git a/cfg-common-opts.h b/cfg-common-opts.h index 7c85e8885a..377472a891 100644 --- a/cfg-common-opts.h +++ b/cfg-common-opts.h @@ -40,9 +40,7 @@ #ifdef CONFIG_PRIORITY {"priority", &proc_priority, CONF_TYPE_STRING, 0, 0, 0, NULL}, #endif -#ifdef CONFIG_WIN32DLL {"codecpath", &codec_path, CONF_TYPE_STRING, 0, 0, 0, NULL}, -#endif {"noconfig", noconfig_opts, CONF_TYPE_SUBCONFIG, CONF_GLOBAL|CONF_NOCFG|CONF_PRE_PARSE, 0, 0, NULL}, // ------------------------- stream options -------------------- diff --git a/get_path.c b/get_path.c index ad3c422639..90d428a4df 100644 --- a/get_path.c +++ b/get_path.c @@ -175,3 +175,21 @@ void set_path_env(void) mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); } #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ + +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/get_path.h b/get_path.h index 2f1909b601..6713762937 100644 --- a/get_path.h +++ b/get_path.h @@ -21,7 +21,10 @@ #ifndef MPLAYER_GET_PATH_H #define MPLAYER_GET_PATH_H +extern char *def_path; + char *get_path(const char *filename); void set_path_env(void); +void SetCodecPath(const char *path); #endif /* MPLAYER_GET_PATH_H */ diff --git a/libmpcodecs/vd_xanim.c b/libmpcodecs/vd_xanim.c index 6067e5add6..66fbb95175 100644 --- a/libmpcodecs/vd_xanim.c +++ b/libmpcodecs/vd_xanim.c @@ -29,11 +29,10 @@ #include <string.h> /* strerror */ #include "config.h" - +#include "get_path.h" #include "mp_msg.h" #include "vd_internal.h" -#include "loader/codecpath.h" static const vd_info_t info = { "XAnim codecs", diff --git a/loader/codecpath.c b/loader/codecpath.c deleted file mode 100644 index 0996f592f1..0000000000 --- a/loader/codecpath.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 deleted file mode 100644 index 0532e9a3a1..0000000000 --- a/loader/codecpath.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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 bfc57a4d1c..ece4aa3456 100644 --- a/loader/drv.c +++ b/loader/drv.c @@ -25,7 +25,7 @@ #ifndef __MINGW32__ #include "ext.h" #endif -#include "codecpath.h" +#include "get_path.h" #if 1 diff --git a/loader/elfdll.c b/loader/elfdll.c index fe88227240..b0317bf91a 100644 --- a/loader/elfdll.c +++ b/loader/elfdll.c @@ -18,7 +18,7 @@ #include "wine/debugtools.h" #include "wine/winerror.h" #include "debug.h" -#include "codecpath.h" +#include "get_path.h" //DEFAULT_DEBUG_CHANNEL(elfdll) diff --git a/loader/module.c b/loader/module.c index 98b31125af..0d4f8087ce 100644 --- a/loader/module.c +++ b/loader/module.c @@ -46,7 +46,7 @@ #endif #include "win32.h" #include "drv.h" -#include "codecpath.h" +#include "get_path.h" #ifdef EMU_QTX_API #include "wrapper.h" diff --git a/loader/win32.c b/loader/win32.c index 9ca0a4a3ab..52a7b2c6c5 100644 --- a/loader/win32.c +++ b/loader/win32.c @@ -49,7 +49,7 @@ for DLL to know too much about its environment. #include "loader.h" #include "com.h" #include "ext.h" -#include "codecpath.h" +#include "get_path.h" #include <stdlib.h> #include <assert.h> diff --git a/mencoder.c b/mencoder.c index df916527bd..dcddaa649a 100644 --- a/mencoder.c +++ b/mencoder.c @@ -65,7 +65,6 @@ #include "mp_fifo.h" #include "get_path.h" -#include "loader/codecpath.h" #include "stream/stream.h" #include "libmpdemux/aviprint.h" #include "libmpdemux/demuxer.h" @@ -667,10 +666,8 @@ if (frameno_filename) { set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif // check font #ifdef CONFIG_FREETYPE @@ -94,7 +94,6 @@ #include "gui/interface.h" #include "input/input.h" -#include "loader/codecpath.h" int slave_mode=0; int player_idle_mode=0; @@ -2702,10 +2701,8 @@ int gui_no_filename=0; set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif #ifndef CONFIG_GUI if(use_gui){ |