changeset 30900:e907ff9e7e77

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.
author diego
date Sat, 20 Mar 2010 23:27:07 +0000
parents 5c4742884b38
children 76a13038105e
files Makefile cfg-common-opts.h get_path.c get_path.h libmpcodecs/vd_xanim.c loader/codecpath.c loader/codecpath.h loader/drv.c loader/elfdll.c loader/module.c loader/win32.c mencoder.c mplayer.c
diffstat 13 files changed, 26 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- 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 \
--- 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 --------------------
--- 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;
+}
--- 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 */
--- 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 <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",
--- 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 <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;
-}
--- 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 */
--- 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
 
--- 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)
 
--- 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"
--- 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 <stdlib.h>
 #include <assert.h>
--- 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
--- 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){