# HG changeset patch # User diego # Date 1269127627 0 # Node ID e907ff9e7e77a4f9183b32638861ca5986cd9a0d # Parent 5c4742884b384804e10aab28cd5ceedb62936f15 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. diff -r 5c4742884b38 -r e907ff9e7e77 Makefile --- a/Makefile Sat Mar 20 01:33:54 2010 +0000 +++ b/Makefile Sat Mar 20 23:27:07 2010 +0000 @@ -315,7 +315,6 @@ 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 -r 5c4742884b38 -r e907ff9e7e77 cfg-common-opts.h --- a/cfg-common-opts.h Sat Mar 20 01:33:54 2010 +0000 +++ b/cfg-common-opts.h Sat Mar 20 23:27:07 2010 +0000 @@ -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 -r 5c4742884b38 -r e907ff9e7e77 get_path.c --- a/get_path.c Sat Mar 20 01:33:54 2010 +0000 +++ b/get_path.c Sat Mar 20 23:27:07 2010 +0000 @@ -175,3 +175,21 @@ 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 -r 5c4742884b38 -r e907ff9e7e77 get_path.h --- a/get_path.h Sat Mar 20 01:33:54 2010 +0000 +++ b/get_path.h Sat Mar 20 23:27:07 2010 +0000 @@ -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 -r 5c4742884b38 -r e907ff9e7e77 libmpcodecs/vd_xanim.c --- a/libmpcodecs/vd_xanim.c Sat Mar 20 01:33:54 2010 +0000 +++ b/libmpcodecs/vd_xanim.c Sat Mar 20 23:27:07 2010 +0000 @@ -29,11 +29,10 @@ #include /* 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 -r 5c4742884b38 -r e907ff9e7e77 loader/codecpath.c --- a/loader/codecpath.c Sat Mar 20 01:33:54 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* - * Modified for use with MPlayer, detailed changelog at - * http://svn.mplayerhq.hu/mplayer/trunk/ - */ - -#include -#include -#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 -r 5c4742884b38 -r e907ff9e7e77 loader/codecpath.h --- a/loader/codecpath.h Sat Mar 20 01:33:54 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -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 -r 5c4742884b38 -r e907ff9e7e77 loader/drv.c --- a/loader/drv.c Sat Mar 20 01:33:54 2010 +0000 +++ b/loader/drv.c Sat Mar 20 23:27:07 2010 +0000 @@ -25,7 +25,7 @@ #ifndef __MINGW32__ #include "ext.h" #endif -#include "codecpath.h" +#include "get_path.h" #if 1 diff -r 5c4742884b38 -r e907ff9e7e77 loader/elfdll.c --- a/loader/elfdll.c Sat Mar 20 01:33:54 2010 +0000 +++ b/loader/elfdll.c Sat Mar 20 23:27:07 2010 +0000 @@ -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 -r 5c4742884b38 -r e907ff9e7e77 loader/module.c --- a/loader/module.c Sat Mar 20 01:33:54 2010 +0000 +++ b/loader/module.c Sat Mar 20 23:27:07 2010 +0000 @@ -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 -r 5c4742884b38 -r e907ff9e7e77 loader/win32.c --- a/loader/win32.c Sat Mar 20 01:33:54 2010 +0000 +++ b/loader/win32.c Sat Mar 20 23:27:07 2010 +0000 @@ -49,7 +49,7 @@ #include "loader.h" #include "com.h" #include "ext.h" -#include "codecpath.h" +#include "get_path.h" #include #include diff -r 5c4742884b38 -r e907ff9e7e77 mencoder.c --- a/mencoder.c Sat Mar 20 01:33:54 2010 +0000 +++ b/mencoder.c Sat Mar 20 23:27:07 2010 +0000 @@ -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 @@ set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif // check font #ifdef CONFIG_FREETYPE diff -r 5c4742884b38 -r e907ff9e7e77 mplayer.c --- a/mplayer.c Sat Mar 20 01:33:54 2010 +0000 +++ b/mplayer.c Sat Mar 20 23:27:07 2010 +0000 @@ -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 @@ set_priority(); #endif -#ifdef CONFIG_WIN32DLL if (codec_path) SetCodecPath(codec_path); -#endif #ifndef CONFIG_GUI if(use_gui){