comparison libmpcodecs/ad_realaud.c @ 30846:72ae3dd3aa6e

Replace separate Win32, XAnim and Real codec directories by one global dir. Nowadays MPlayer does not use the codecs from other installed programs. A runtime setting will soon take over the rare case that binary codecs should be searched for in non-standard directories.
author diego
date Sun, 14 Mar 2010 16:13:32 +0000
parents 2b9abdf8f6bf
children a34f16fb8823
comparison
equal deleted inserted replaced
30845:ab30cba9b037 30846:72ae3dd3aa6e
249 // let's check if the driver is available, return 0 if not. 249 // let's check if the driver is available, return 0 if not.
250 // (you should do that if you use external lib(s) which is optional) 250 // (you should do that if you use external lib(s) which is optional)
251 unsigned int result; 251 unsigned int result;
252 char *path; 252 char *path;
253 253
254 path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2); 254 path = malloc(strlen(BINARY_CODECS_PATH) + strlen(sh->codec->dll) + 2);
255 if (!path) return 0; 255 if (!path) return 0;
256 sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll); 256 sprintf(path, BINARY_CODECS_PATH "/%s", sh->codec->dll);
257 257
258 /* first try to load linux dlls, if failed and we're supporting win32 dlls, 258 /* first try to load linux dlls, if failed and we're supporting win32 dlls,
259 then try to load the windows ones */ 259 then try to load the windows ones */
260 260
261 #ifdef HAVE_LIBDL 261 #ifdef HAVE_LIBDL
275 if((raSetDLLAccessPath && dll_type == 0) || (wraSetDLLAccessPath && dll_type == 1)){ 275 if((raSetDLLAccessPath && dll_type == 0) || (wraSetDLLAccessPath && dll_type == 1)){
276 #else 276 #else
277 if(raSetDLLAccessPath){ 277 if(raSetDLLAccessPath){
278 #endif 278 #endif
279 // used by 'SIPR' 279 // used by 'SIPR'
280 path = realloc(path, strlen(REALCODEC_PATH) + 13); 280 path = realloc(path, strlen(BINARY_CODECS_PATH) + 13);
281 sprintf(path, "DT_Codecs=" REALCODEC_PATH); 281 sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH);
282 if(path[strlen(path)-1]!='/'){ 282 if(path[strlen(path)-1]!='/'){
283 path[strlen(path)+1]=0; 283 path[strlen(path)+1]=0;
284 path[strlen(path)]='/'; 284 path[strlen(path)]='/';
285 } 285 }
286 path[strlen(path)+1]=0; 286 path[strlen(path)+1]=0;
298 } 298 }
299 299
300 #ifdef CONFIG_WIN32DLL 300 #ifdef CONFIG_WIN32DLL
301 if (dll_type == 1){ 301 if (dll_type == 1){
302 if(wraOpenCodec2) 302 if(wraOpenCodec2)
303 result=wraOpenCodec2(&sh->context,REALCODEC_PATH "\\"); 303 result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\");
304 else 304 else
305 result=wraOpenCodec(&sh->context); 305 result=wraOpenCodec(&sh->context);
306 } else 306 } else
307 #endif 307 #endif
308 if(raOpenCodec2) 308 if(raOpenCodec2)
309 result=raOpenCodec2(&sh->context,REALCODEC_PATH "/"); 309 result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/");
310 else 310 else
311 result=raOpenCodec(&sh->context); 311 result=raOpenCodec(&sh->context);
312 if(result){ 312 if(result){
313 mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result); 313 mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);
314 return 0; 314 return 0;