diff get_path.c @ 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 88e57c2b3f58
children
line wrap: on
line diff
--- 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;
+}