mirror of https://github.com/mpv-player/mpv
first try to load linux dlls, if failed and we're supporting win32 dlls, then try to load the windows ones
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6544 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ecff630554
commit
b4423c2714
|
@ -1,5 +1,3 @@
|
||||||
//#define USE_WIN32_REAL_CODECS
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -67,10 +65,8 @@ static int control(sh_video_t *sh,int cmd,void* arg,...){
|
||||||
return CONTROL_UNKNOWN;
|
return CONTROL_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USE_WIN32_REAL_CODECS
|
|
||||||
|
|
||||||
/* exits program when failure */
|
/* exits program when failure */
|
||||||
int load_syms(char *path) {
|
int load_syms_linux(char *path) {
|
||||||
void *handle;
|
void *handle;
|
||||||
char *error;
|
char *error;
|
||||||
|
|
||||||
|
@ -98,9 +94,8 @@ int load_syms(char *path) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#ifdef USE_WIN32DLL
|
||||||
|
int load_syms_windows(char *path) {
|
||||||
int load_syms(char *path) {
|
|
||||||
void *handle;
|
void *handle;
|
||||||
Setup_LDT_Keeper();
|
Setup_LDT_Keeper();
|
||||||
rv_handle = handle = LoadLibraryA(path);
|
rv_handle = handle = LoadLibraryA(path);
|
||||||
|
@ -119,7 +114,6 @@ int load_syms(char *path) {
|
||||||
rvyuv_transform) return 1;
|
rvyuv_transform) return 1;
|
||||||
return 0; // error
|
return 0; // error
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* we need exact positions */
|
/* we need exact positions */
|
||||||
|
@ -148,7 +142,14 @@ static int init(sh_video_t *sh){
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",extrahdr[1],extrahdr[0]);
|
mp_msg(MSGT_DECVIDEO,MSGL_V,"realvideo codec id: 0x%08X sub-id: 0x%08X\n",extrahdr[1],extrahdr[0]);
|
||||||
|
|
||||||
sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);
|
sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);
|
||||||
if(!load_syms(path)){
|
|
||||||
|
/* first try to load linux dlls, if failed and we're supporting win32 dlls,
|
||||||
|
then try to load the windows ones */
|
||||||
|
if(!load_syms_linux(path))
|
||||||
|
#ifdef USE_WIN32DLLS
|
||||||
|
if (!load_syms_windows(path))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"You need to copy the contents from the RealPlayer codecs directory\n");
|
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"You need to copy the contents from the RealPlayer codecs directory\n");
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"into " REALCODEC_PATH "/ !\n");
|
mp_msg(MSGT_DECVIDEO,MSGL_HINT,"into " REALCODEC_PATH "/ !\n");
|
||||||
|
|
Loading…
Reference in New Issue