[MPlayer-dev-eng] [PATCH] Win32 codec paths in vd_realvid.c

Glyn Kennington glyn.kennington at hertford.oxford.ac.uk
Sat Jun 28 11:00:01 CEST 2003


This might be a bug, or I might have misunderstood the codec loader.  Shout
at me iff it's the latter.

In libmpcodecs/vd_realvid.c , near the start of function init(sh_video_t
*sh), there's the following chunk of code:

  sprintf(path, REALCODEC_PATH "/%s", sh->codec->dll);

  /* first try to load linux dlls, if failed and we're supporting win32 dlls,
     then try to load the windows ones */
#ifdef HAVE_LIBDL       
  if(strstr(sh->codec->dll,".dll") || !load_syms_linux(path))
#endif
#ifdef USE_WIN32DLL
      if (!load_syms_windows(path))

This causes load_syms_windows to use the whole path as libname, and tries to
search for this full path in each of the win codecs directories.  For
example, (when drv43260.dll can be found in /usr/lib/win32) the following
error results from using -vc rv40win :


Forced video codec: rv40win
Opening video decoder: [realvid] RealVideo decoder
opening win32 dll '/usr/lib/RealPlayer8/Codecs/drv43260.dll'
Win32 LoadLibrary failed to load: /usr/lib/RealPlayer8/Codecs/drv43260.dll, /usr/lib/win32//usr/lib/RealPlayer8/Codecs/drv43260.dll, /usr/local/lib/win32//usr/lib/RealPlayer8/Codecs/drv43260.dll
Error loading dll
ERROR: Could not open required DirectShow codec drv43260.dll.
Read the RealVideo section of the DOCS!
VDecoder init failed :(


What I *think* it should be doing is

      if (!load_syms_windows(sh->codec->dll))

This produces:


Forced video codec: rv40win
Opening video decoder: [realvid] RealVideo decoder
opening win32 dll 'drv43260.dll'
Called unk__beginthreadex
Selected video codec: [rv40win] vfm:realvid (Win32 RealPlayer 9 RV40 decoder)


The same thing happens in ad_realaud.c.  The change is trivial, but I've
attached a patch for both files, against current CVS.

Glyn

-- 
I can't control my fingers, I can't control my brain.
-------------- next part --------------
Index: libmpcodecs/ad_realaud.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_realaud.c,v
retrieving revision 1.26
diff -u -r1.26 ad_realaud.c
--- libmpcodecs/ad_realaud.c	20 May 2003 19:19:32 -0000	1.26
+++ libmpcodecs/ad_realaud.c	28 Jun 2003 08:48:09 -0000
@@ -223,7 +223,7 @@
     if (strstr(sh->codec->dll,".dll") || !load_syms_linux(path))
 #endif
 #ifdef USE_WIN32DLL
-	if (!load_sysm_windows(path))
+	if (!load_sysm_windows(sh->codec->dll))
 #endif
     {
 	mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MissingDLLcodec, sh->codec->dll);
Index: libmpcodecs/vd_realvid.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_realvid.c,v
retrieving revision 1.24
diff -u -r1.24 vd_realvid.c
--- libmpcodecs/vd_realvid.c	20 May 2003 19:19:32 -0000	1.24
+++ libmpcodecs/vd_realvid.c	28 Jun 2003 08:48:10 -0000
@@ -211,7 +211,7 @@
 	if(strstr(sh->codec->dll,".dll") || !load_syms_linux(path))
 #endif
 #ifdef USE_WIN32DLL
-	    if (!load_syms_windows(path))
+	    if (!load_syms_windows(sh->codec->dll))
 #endif
 	{
 		mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingDLLcodec,sh->codec->dll);


More information about the MPlayer-dev-eng mailing list