[MPlayer-cvslog] r30942 - in trunk: 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...

diego subversion at mplayerhq.hu
Sun Mar 21 00:27:07 CET 2010


Author: diego
Date: Sun Mar 21 00:27:07 2010
New Revision: 30942

Log:
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.

Deleted:
   trunk/loader/codecpath.c
   trunk/loader/codecpath.h
Modified:
   trunk/Makefile
   trunk/cfg-common-opts.h
   trunk/get_path.c
   trunk/get_path.h
   trunk/libmpcodecs/vd_xanim.c
   trunk/loader/drv.c
   trunk/loader/elfdll.c
   trunk/loader/module.c
   trunk/loader/win32.c
   trunk/mencoder.c
   trunk/mplayer.c

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/Makefile	Sun Mar 21 00:27:07 2010	(r30942)
@@ -315,7 +315,6 @@ SRCS_COMMON-$(WIN32DLL)              += 
                                         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 \

Modified: trunk/cfg-common-opts.h
==============================================================================
--- trunk/cfg-common-opts.h	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/cfg-common-opts.h	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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 --------------------

Modified: trunk/get_path.c
==============================================================================
--- trunk/get_path.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/get_path.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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;
+}

Modified: trunk/get_path.h
==============================================================================
--- trunk/get_path.h	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/get_path.h	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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 */

Modified: trunk/libmpcodecs/vd_xanim.c
==============================================================================
--- trunk/libmpcodecs/vd_xanim.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/libmpcodecs/vd_xanim.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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",

Modified: trunk/loader/drv.c
==============================================================================
--- trunk/loader/drv.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/loader/drv.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -25,7 +25,7 @@
 #ifndef __MINGW32__
 #include "ext.h"
 #endif
-#include "codecpath.h"
+#include "get_path.h"
 
 #if 1
 

Modified: trunk/loader/elfdll.c
==============================================================================
--- trunk/loader/elfdll.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/loader/elfdll.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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)
 

Modified: trunk/loader/module.c
==============================================================================
--- trunk/loader/module.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/loader/module.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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"

Modified: trunk/loader/win32.c
==============================================================================
--- trunk/loader/win32.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/loader/win32.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -49,7 +49,7 @@ for DLL to know too much about its envir
 #include "loader.h"
 #include "com.h"
 #include "ext.h"
-#include "codecpath.h"
+#include "get_path.h"
 
 #include <stdlib.h>
 #include <assert.h>

Modified: trunk/mencoder.c
==============================================================================
--- trunk/mencoder.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/mencoder.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sat Mar 20 02:33:54 2010	(r30941)
+++ trunk/mplayer.c	Sun Mar 21 00:27:07 2010	(r30942)
@@ -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){


More information about the MPlayer-cvslog mailing list