1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

Real binary loader code should respect the binary codec path.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30948 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2010-03-23 17:52:46 +00:00
parent 364fb6d26f
commit cb26eaf0bb
2 changed files with 16 additions and 12 deletions

View File

@ -27,6 +27,7 @@
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif
#include "help_mp.h" #include "help_mp.h"
#include "path.h"
#include "ad_internal.h" #include "ad_internal.h"
#include "loader/wine/windef.h" #include "loader/wine/windef.h"
@ -251,9 +252,9 @@ static int preinit(sh_audio_t *sh){
unsigned int result; unsigned int result;
char *path; 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; 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, /* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */ then try to load the windows ones */
@ -277,8 +278,8 @@ static int preinit(sh_audio_t *sh){
if(raSetDLLAccessPath){ if(raSetDLLAccessPath){
#endif #endif
// used by 'SIPR' // used by 'SIPR'
path = realloc(path, strlen(BINARY_CODECS_PATH) + 13); path = realloc(path, strlen(def_path) + 13);
sprintf(path, "DT_Codecs=" BINARY_CODECS_PATH); sprintf(path, "DT_Codecs=%s", def_path);
if(path[strlen(path)-1]!='/'){ if(path[strlen(path)-1]!='/'){
path[strlen(path)+1]=0; path[strlen(path)+1]=0;
path[strlen(path)]='/'; path[strlen(path)]='/';
@ -299,15 +300,17 @@ static int preinit(sh_audio_t *sh){
#ifdef CONFIG_WIN32DLL #ifdef CONFIG_WIN32DLL
if (dll_type == 1){ if (dll_type == 1){
if(wraOpenCodec2) if (wraOpenCodec2) {
result = wraOpenCodec2(&sh->context, BINARY_CODECS_PATH "\\"); sprintf(path, "%s\\", def_path);
else result = wraOpenCodec2(&sh->context, path);
} else
result=wraOpenCodec(&sh->context); result=wraOpenCodec(&sh->context);
} else } else
#endif #endif
if(raOpenCodec2) if (raOpenCodec2) {
result = raOpenCodec2(&sh->context, BINARY_CODECS_PATH "/"); sprintf(path, "%s/", def_path);
else result = raOpenCodec2(&sh->context, path);
} else
result=raOpenCodec(&sh->context); result=raOpenCodec(&sh->context);
if(result){ if(result){
mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result); mp_msg(MSGT_DECAUDIO,MSGL_WARN,"Decoder open failed, error code: 0x%X\n",result);

View File

@ -28,6 +28,7 @@
#include "mp_msg.h" #include "mp_msg.h"
#include "help_mp.h" #include "help_mp.h"
#include "mpbswap.h" #include "mpbswap.h"
#include "path.h"
#include "vd_internal.h" #include "vd_internal.h"
#include "loader/wine/windef.h" #include "loader/wine/windef.h"
@ -273,9 +274,9 @@ static int init(sh_video_t *sh){
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])); 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; 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, /* first try to load linux dlls, if failed and we're supporting win32 dlls,
then try to load the windows ones */ then try to load the windows ones */