changeset 30906:a34f16fb8823

Real binary loader code should respect the binary codec path.
author diego
date Tue, 23 Mar 2010 17:52:46 +0000
parents 6ca66cec8a15
children b32527b30d17
files libmpcodecs/ad_realaud.c libmpcodecs/vd_realvid.c
diffstat 2 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_realaud.c	Mon Mar 22 19:39:43 2010 +0000
+++ b/libmpcodecs/ad_realaud.c	Tue Mar 23 17:52:46 2010 +0000
@@ -27,6 +27,7 @@
 #include <dlfcn.h>
 #endif
 #include "help_mp.h"
+#include "path.h"
 
 #include "ad_internal.h"
 #include "loader/wine/windef.h"
@@ -251,9 +252,9 @@
   unsigned int result;
   char *path;
 
-  path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2);
+  path = malloc(strlen(def_path) + strlen(sh->codec->dll) + 2);
   if (!path) return 0;
-  sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll);
+  sprintf(path, "%s/%s", def_path, sh->codec->dll);
 
     /* first try to load linux dlls, if failed and we're supporting win32 dlls,
        then try to load the windows ones */
@@ -277,8 +278,8 @@
   if(raSetDLLAccessPath){
 #endif
       // used by 'SIPR'
-      path = realloc(path, strlen(BINARY_CODECS_PATH) + 13);
-      sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH);
+      path = realloc(path, strlen(def_path) + 13);
+      sprintf(path, "DT_Codecs=%s", def_path);
       if(path[strlen(path)-1]!='/'){
         path[strlen(path)+1]=0;
         path[strlen(path)]='/';
@@ -299,15 +300,17 @@
 
 #ifdef CONFIG_WIN32DLL
     if (dll_type == 1){
-      if(wraOpenCodec2)
-	result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\");
-      else
+      if (wraOpenCodec2) {
+        sprintf(path, "%s\\", def_path);
+        result = wraOpenCodec2(&sh->context, path);
+      } else
 	result=wraOpenCodec(&sh->context);
     } else
 #endif
-    if(raOpenCodec2)
-      result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/");
-    else
+    if (raOpenCodec2) {
+      sprintf(path, "%s/", def_path);
+      result = raOpenCodec2(&sh->context, path);
+    } else
       result=raOpenCodec(&sh->context);
     if(result){
       mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);
--- a/libmpcodecs/vd_realvid.c	Mon Mar 22 19:39:43 2010 +0000
+++ b/libmpcodecs/vd_realvid.c	Tue Mar 23 17:52:46 2010 +0000
@@ -28,6 +28,7 @@
 #include "mp_msg.h"
 #include "help_mp.h"
 #include "mpbswap.h"
+#include "path.h"
 
 #include "vd_internal.h"
 #include "loader/wine/windef.h"
@@ -273,9 +274,9 @@
 
 	mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X  sub-id: 0x%08X\n",be2me_32(((unsigned int*)extrahdr)[1]),be2me_32(((unsigned int*)extrahdr)[0]));
 
-	path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2);
+	path = malloc(strlen(def_path) + strlen(sh->codec->dll) + 2);
 	if (!path) return 0;
-	sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll);
+	sprintf(path, "%s/%s", def_path, sh->codec->dll);
 
 	/* first try to load linux dlls, if failed and we're supporting win32 dlls,
 	   then try to load the windows ones */