changeset 7752:18f8233094da

tell the codec wrapper the codec path (fixes realaudio Sipr)
author arpi
date Wed, 16 Oct 2002 15:59:04 +0000
parents 27c9c440536f
children f569630d892f
files libmpcodecs/ad_realaud.c
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_realaud.c	Wed Oct 16 15:35:28 2002 +0000
+++ b/libmpcodecs/ad_realaud.c	Wed Oct 16 15:59:04 2002 +0000
@@ -41,7 +41,7 @@
 static unsigned long (*raInitDecoder)(void*, void*);
 static unsigned long (*raOpenCodec2)(void*);
 static unsigned long (*raSetFlavor)(void*,unsigned long);
-//static void  (*raSetDLLAccessPath)(unsigned long);
+static void  (*raSetDLLAccessPath)(char*);
 static void  (*raSetPwd)(char*,char*);
 
 typedef struct {
@@ -77,16 +77,26 @@
     raOpenCodec2 = dlsym(handle, "RAOpenCodec2");
     raInitDecoder = dlsym(handle, "RAInitDecoder");
     raSetFlavor = dlsym(handle, "RASetFlavor");
-//    raSetDLLAccessPath = dlsym(handle, "SetDLLAccessPath");
+    raSetDLLAccessPath = dlsym(handle, "SetDLLAccessPath");
     raSetPwd = dlsym(handle, "RASetPwd"); // optional, used by SIPR
     
   if(!raCloseCodec || !raDecode || !raFlush || !raFreeDecoder ||
      !raGetFlavorProperty || !raOpenCodec2 || !raSetFlavor ||
      /*!raSetDLLAccessPath ||*/ !raInitDecoder){
-      mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Cannot resolve symbols - incompatible dll\n");
+      mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Cannot resolve symbols - incompatible dll: %s\n",path);
       return 0;
   }
 
+  if(raSetDLLAccessPath){
+      sprintf(path, "DT_Codecs=" REALCODEC_PATH);
+      if(path[strlen(path)-1]!='/'){
+        path[strlen(path)+1]=0;
+        path[strlen(path)]='/';
+      }
+      path[strlen(path)+1]=0;
+      raSetDLLAccessPath(path);
+  }
+
     result=raOpenCodec2(&sh->context);
     if(result){
       mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);